diff --git a/deploy_gb.sh b/deploy_gb.sh index 91ee554..866b6a5 100644 --- a/deploy_gb.sh +++ b/deploy_gb.sh @@ -176,16 +176,20 @@ echo " ✓ No critical errors in logs" # 6.2 Nginx 설정 검증 echo " Checking Nginx configuration..." 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 +if command -v sudo >/dev/null 2>&1 && sudo -n true 2>/dev/null; then + if ! sudo -n 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 + echo " ✓ Nginx configuration is valid" +else + echo " ⚠️ Skipping Nginx validation: sudo -n unavailable in this environment" fi rm -f "$NGINX_TEST_LOG" -echo " ✓ Nginx configuration is valid" # 6.3 프로세스가 여전히 실행 중인지 확인 if ! ps -p $NEW_PID > /dev/null; then