Skip to content

Commit 53f63cc

Browse files
committed
fix: CD 헬스체크 루프 종료 처리
1 parent d62d1ab commit 53f63cc

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

.github/workflows/cd.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,20 @@ jobs:
5959
docker compose -f docker-compose-prod.yml up -d spring-$TARGET
6060
6161
echo "⏳ Waiting for health check on $PORT..."
62+
HEALTHY=false
6263
for i in {1..20}; do
6364
if curl -sf http://localhost:$PORT/actuator/health > /dev/null; then
64-
echo "✅ spring-$TARGET is healthy"
65-
exit 0
65+
HEALTHY=true
66+
break
6667
fi
6768
echo "⏳ still waiting..."
6869
sleep 5
6970
done
71+
72+
if [ "$HEALTHY" = "true" ]; then
73+
echo "✅ spring-$TARGET is healthy"
74+
exit 0
75+
fi
7076
7177
echo "❌ Health check failed for spring-$TARGET - rolling back"
7278
docker compose -f docker-compose-prod.yml stop spring-$TARGET

0 commit comments

Comments
 (0)