From 7de00ecad25ec25583e86327e5d68b0b0c053038 Mon Sep 17 00:00:00 2001 From: Rinjae Date: Tue, 16 Jun 2026 16:22:07 +0900 Subject: [PATCH] =?UTF-8?q?ci=20-=20readiness=20probe=20=EC=95=88=EC=A0=95?= =?UTF-8?q?=ED=99=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - probe URL 변경: login.do(POST) → loginForm.do(GET) - timeout 180s → 300s (200MB war 첫 explode 시간 확보) - 실패 시 catalina 로그 300줄 + systemd status + 포트 출력 Co-Authored-By: Claude Opus 4.7 --- .gitea/workflows/eapim-admin-ci.yml | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/.gitea/workflows/eapim-admin-ci.yml b/.gitea/workflows/eapim-admin-ci.yml index eba94c0..26053b2 100644 --- a/.gitea/workflows/eapim-admin-ci.yml +++ b/.gitea/workflows/eapim-admin-ci.yml @@ -89,7 +89,7 @@ jobs: cp eapim-admin/build/libs/eapim-admin.war "$DEPLOY_DIR/monitoring.war" ls -la "$DEPLOY_DIR" - - name: Start tomcat and readiness probe (timeout 180s) + - name: Start tomcat and readiness probe (timeout 300s) working-directory: ${{ github.workspace }} run: | LOG="$CATALINA_BASE/logs/catalina.$(date +%Y-%m-%d).log" @@ -99,14 +99,17 @@ jobs: # systemd 가 Tomcat 을 새 cgroup 으로 띄움 — runner step 종료와 무관하게 살아남음 systemctl --user start eapim-admin - DEADLINE=$(($(date +%s) + 180)) + # /loginForm.do 는 GET 매핑(MainController#loginForm) → tomcat·webapp 양쪽 살아있으면 200 + # /login.do 는 POST 처리 — GET 으로 probe 시 405/잘못된 응답 가능성 있어 회피 + PROBE_URL="http://localhost:$DEPLOY_HTTP_PORT/monitoring/loginForm.do" + DEADLINE=$(($(date +%s) + 300)) STATUS=000 while [ $(date +%s) -lt $DEADLINE ]; do STATUS=$(curl -sS -o /dev/null -w '%{http_code}' --max-time 3 \ - "http://localhost:$DEPLOY_HTTP_PORT/monitoring/login.do" 2>/dev/null || echo "000") + "$PROBE_URL" 2>/dev/null || echo "000") case "$STATUS" in 200|302|401) - echo "Readiness OK (/monitoring/login.do HTTP $STATUS)" + echo "Readiness OK ($PROBE_URL HTTP $STATUS)" break ;; esac @@ -122,8 +125,13 @@ jobs: case "$STATUS" in 200|302|401) ;; *) - echo "::error::Readiness probe failed within 180s (last HTTP status: $STATUS)" - [ -f "$LOG" ] && tail -c +$((BEFORE+1)) "$LOG" | tail -100 + echo "::error::Readiness probe failed within 300s (last HTTP status: $STATUS)" + echo "--- last 300 lines of catalina log ---" + [ -f "$LOG" ] && tail -c +$((BEFORE+1)) "$LOG" | tail -300 + echo "--- systemd unit status ---" + systemctl --user status eapim-admin --no-pager || true + echo "--- listening ports ---" + ss -tlnp 2>/dev/null | grep -E ":$DEPLOY_HTTP_PORT\b" || echo "(port $DEPLOY_HTTP_PORT 미점유)" exit 1 ;; esac