Fix nginx validation in deploy pipeline
TaxBaik CI/CD / build-and-deploy (push) Failing after 55s

This commit is contained in:
2026-07-09 13:14:43 +09:00
parent 98bb05a084
commit 3ed0eb0119
2 changed files with 14 additions and 1 deletions
+9
View File
@@ -279,6 +279,15 @@ jobs:
exit 1
fi
NGINX_TEST_LOG=\$(mktemp)
if ! sudo nginx -t >"\$NGINX_TEST_LOG" 2>&1; then
echo "❌ Nginx configuration is invalid" >&2
tail -50 "\$NGINX_TEST_LOG" >&2 || true
rm -f "\$NGINX_TEST_LOG"
exit 1
fi
rm -f "\$NGINX_TEST_LOG"
echo "✓ Nginx 설정 검증 통과 (실제 로드 파일 확인 + 포트 5001 고정 + trailing slash 없음)"
echo "--- [5/5] 헬스 체크 (최대 60초) ---"
+5 -1
View File
@@ -175,12 +175,16 @@ echo " ✓ No critical errors in logs"
# 6.2 Nginx 설정 검증
echo " Checking Nginx configuration..."
if ! sudo nginx -t 2>&1 | grep -q "successful"; then
NGINX_TEST_LOG=$(mktemp)
if ! sudo nginx -t >"$NGINX_TEST_LOG" 2>&1; then
echo "❌ Nginx configuration is invalid"
tail -50 "$NGINX_TEST_LOG" 2>/dev/null || true
rm -f "$NGINX_TEST_LOG"
echo "🔙 Rolling back..."
kill -9 $NEW_PID || true
exit 1
fi
rm -f "$NGINX_TEST_LOG"
echo " ✓ Nginx configuration is valid"
# 6.3 프로세스가 여전히 실행 중인지 확인