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 <noreply@anthropic.com>
This commit is contained in:
@@ -61,7 +61,9 @@ NGINX
|
|||||||
|
|
||||||
echo "==> Starting $TARGET (waiting for health check)..."
|
echo "==> Starting $TARGET (waiting for health check)..."
|
||||||
if ! $COMPOSE --profile "$TARGET" up -d --wait; then
|
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"
|
$COMPOSE stop "${TARGET}-app" "${TARGET}-worker" "${TARGET}-scheduler"
|
||||||
LATEST=$($COMPOSE run --rm --entrypoint "" "${TARGET}-app" \
|
LATEST=$($COMPOSE run --rm --entrypoint "" "${TARGET}-app" \
|
||||||
sh -c "ls -t /app/data/app.db.pre-deploy-* 2>/dev/null | head -1")
|
sh -c "ls -t /app/data/app.db.pre-deploy-* 2>/dev/null | head -1")
|
||||||
|
|||||||
Reference in New Issue
Block a user