File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -180,18 +180,20 @@ jobs:
180180 echo "[5/9] Health check http://127.0.0.1:${TARGET_PORT}${HEALTHCHECK_PATH}"
181181 ok=0
182182 for i in $(seq 1 ${HEALTHCHECK_RETRY}); do
183- if curl -fsS --max-time ${HEALTHCHECK_TIMEOUT} "http://127.0.0.1:${TARGET_PORT}${HEALTHCHECK_PATH}" >/dev/null 2>&1; then
184- ok=1; break
185- fi
186- echo " retry $i/${HEALTHCHECK_RETRY}..."
183+ code=$(curl -s -o /dev/null -w "%{http_code}" --max-time ${HEALTHCHECK_TIMEOUT} \
184+ "http://127.0.0.1:${TARGET_PORT}${HEALTHCHECK_PATH}")
185+ if [ "$code" -ge 200 ] && [ "$code" -lt 400 ]; then
186+ ok=1; break
187+ fi
188+ echo " retry $i/${HEALTHCHECK_RETRY} (code=$code)"
187189 sleep 3
188190 done
189191 if [ "$ok" -ne 1 ]; then
190192 echo "[!] Health check failed. Rollback."
191193 sudo docker logs --tail 200 "${TARGET_NAME}" || true
192194 sudo docker stop "${TARGET_NAME}" || true
193195 sudo docker rm "${TARGET_NAME}" || true
194- exit 1
196+ exit 1
195197 fi
196198
197199 echo "[6/9] Switch upstream to ${TARGET_PORT}"
Original file line number Diff line number Diff line change @@ -61,6 +61,17 @@ spring:
6161 max-idle : 8
6262 min-idle : 2
6363
64+ management :
65+ endpoints :
66+ web :
67+ exposure :
68+ include : health,info
69+ endpoint :
70+ health :
71+ show-details : never
72+ probes :
73+ enabled : true
74+
6475# MyBatis
6576mybatis :
6677 type-aliases-package : com.dreamypatisiel.devdevdev.domain.repository
You can’t perform that action at this time.
0 commit comments