2 Commits

Author SHA1 Message Date
Rinjae 8a884e53e3 ci - readiness probe port 39120 으로 정정
eapim-admin CI / build (push) Has been cancelled
- DEPLOY_HTTP_PORT 30120 → 39120 (실서버 tomcat 포트)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-16 16:30:13 +09:00
Rinjae 7de00ecad2 ci - readiness probe 안정화
eapim-admin CI / build (push) Has been cancelled
- 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 <noreply@anthropic.com>
2026-06-16 16:22:07 +09:00
+15 -7
View File
@@ -17,7 +17,7 @@ jobs:
CATALINA_BASE: /prod/eapim/adminportal
CATALINA_HOME: /prod/eapim/apache-tomcat-9.0.116
CATALINA_PID: /prod/eapim/adminportal/temp/catalina.pid
DEPLOY_HTTP_PORT: "30120"
DEPLOY_HTTP_PORT: "39120"
defaults:
run:
working-directory: eapim-admin
@@ -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