This commit is contained in:
@@ -89,17 +89,36 @@ jobs:
|
||||
|
||||
echo '=== Logging into Docker registry ==='
|
||||
echo '${{ secrets.REGISTRY_PASS }}' | docker login registry.infra.mintel.me -u '${{ secrets.REGISTRY_USER }}' --password-stdin
|
||||
echo '✓ Registry login successful'
|
||||
if [ $? -eq 0 ]; then
|
||||
echo '✓ Registry login successful'
|
||||
else
|
||||
echo '✗ Registry login failed'
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo '=== Checking current containers ==='
|
||||
docker compose ps
|
||||
|
||||
|
||||
echo '=== Checking current image ==='
|
||||
docker images registry.infra.mintel.me/mintel/klz-cables.com:latest
|
||||
|
||||
echo '=== Removing local image to force fresh pull ==='
|
||||
docker rmi registry.infra.mintel.me/mintel/klz-cables.com:latest || true
|
||||
|
||||
echo '=== Pulling latest image ==='
|
||||
docker compose pull
|
||||
echo '✓ Image pulled successfully'
|
||||
|
||||
echo '=== Verifying new image ==='
|
||||
echo '✓ Image pull command completed'
|
||||
|
||||
echo '=== Verifying new image after pull ==='
|
||||
docker images registry.infra.mintel.me/mintel/klz-cables.com:latest
|
||||
|
||||
echo '=== Checking if image was actually updated ==='
|
||||
if docker inspect registry.infra.mintel.me/mintel/klz-cables.com:latest >/dev/null 2>&1; then
|
||||
echo '✓ Image exists locally'
|
||||
else
|
||||
echo '✗ Image pull failed - image not found locally'
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo '=== Stopping all containers ==='
|
||||
docker compose down
|
||||
@@ -120,11 +139,22 @@ jobs:
|
||||
|
||||
echo '=== Checking varnish container logs ==='
|
||||
docker compose logs --tail=20 varnish
|
||||
|
||||
|
||||
echo '=== Verifying application health ==='
|
||||
# Wait a bit more for the app to be fully ready
|
||||
sleep 10
|
||||
if curl -f -s http://localhost:80/health > /dev/null 2>&1; then
|
||||
echo '✓ Application health check passed'
|
||||
else
|
||||
echo '✗ Application health check failed - checking app logs'
|
||||
docker compose logs --tail=50 app
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo '=== Cleaning up old images ==='
|
||||
docker image prune -f --filter 'until=24h'
|
||||
|
||||
|
||||
echo '=== Deployment completed successfully ==='
|
||||
"
|
||||
|
||||
|
||||
echo "Deployment completed"
|
||||
Reference in New Issue
Block a user