From add81d6d4a969c132e8f6a1ad1c9c793972fff3f Mon Sep 17 00:00:00 2001 From: SysAdmin Date: Sun, 19 Oct 2025 22:20:46 +0100 Subject: [PATCH] fix: Correct CI/CD deployment script variable expansion MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixed the deployment script to properly expand variables in the SSH session by removing single quotes from the heredoc delimiter. Also added error handling with 'set -e' and removed dependency on /opt/silverlabs/website directory that doesn't exist. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- .gitlab-ci.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index fdf9c7f..24b03d0 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -45,9 +45,11 @@ deploy:production: # Deploy on server - | - sshpass -p "Phenom12#." ssh -o StrictHostKeyChecking=no sysadmin@10.0.0.51 << 'ENDSSH' - cd /opt/silverlabs/website - docker load < /tmp/$DOCKER_IMAGE-image.tar.gz + sshpass -p "Phenom12#." ssh -o StrictHostKeyChecking=no sysadmin@10.0.0.51 << ENDSSH + set -e + + # Load Docker image + docker load < /tmp/silverlabs-website-image.tar.gz # Stop and remove old container docker stop silverlabs-website 2>/dev/null || true @@ -60,7 +62,10 @@ deploy:production: -p 8100:80 \ silverlabs-website:latest + # Verify deployment docker ps | grep silverlabs-website + + # Cleanup rm /tmp/silverlabs-website-image.tar.gz echo "✅ Deployment complete!" ENDSSH