From e39eaefb43dbdf01c082ba606ad9ab0df2cb06c4 Mon Sep 17 00:00:00 2001 From: Deeman Date: Sun, 22 Feb 2026 13:12:26 +0100 Subject: [PATCH] fix(deploy): dump app container logs on health check failure Makes the crash reason visible in GitLab CI logs instead of just "container is unhealthy". Co-Authored-By: Claude Sonnet 4.6 --- deploy.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/deploy.sh b/deploy.sh index ea27c05..37dac76 100755 --- a/deploy.sh +++ b/deploy.sh @@ -61,7 +61,9 @@ NGINX echo "==> Starting $TARGET (waiting for health check)..." if ! $COMPOSE --profile "$TARGET" up -d --wait; then - echo "!!! Health check failed — rolling back" + echo "!!! Health check failed — dumping logs" + $COMPOSE logs "${TARGET}-app" --tail=100 || true + echo "!!! Rolling back" $COMPOSE stop "${TARGET}-app" "${TARGET}-worker" "${TARGET}-scheduler" LATEST=$($COMPOSE run --rm --entrypoint "" "${TARGET}-app" \ sh -c "ls -t /app/data/app.db.pre-deploy-* 2>/dev/null | head -1")