Merge staging into production: deploy health check follows redirects
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WpTYCBLH58XzrM7n3xPJ5N
This commit is contained in:
@@ -169,10 +169,15 @@ jobs:
|
||||
staging) HOST=192.168.1.111 ;;
|
||||
production) HOST=192.168.1.101 ;;
|
||||
esac
|
||||
# `-L` follows redirects and we assert on the FINAL code, because a 302 from `/`
|
||||
# is a healthy answer for a site running in UnderConstruction mode -- it means the
|
||||
# app is up and routing. Asserting a bare 200 failed jecreativ.ro's first
|
||||
# production deploy for doing exactly what it was configured to do.
|
||||
#
|
||||
# `|| CODE=000` for the same reason as above: curl exiting non-zero on a
|
||||
# connection failure must produce a reportable code, not kill the step before
|
||||
# it can say what went wrong. (`-s` without `-f` already tolerates 4xx/5xx.)
|
||||
CODE=$(curl -s -o /dev/null -w '%{http_code}' -m 20 "http://${HOST}:${WEB_PORT}/") || CODE=000
|
||||
CODE=$(curl -sL -o /dev/null -w '%{http_code}' -m 20 "http://${HOST}:${WEB_PORT}/") || CODE=000
|
||||
if [ "${CODE}" != "200" ]; then
|
||||
echo "::error::Home page returned ${CODE}."
|
||||
exit 1
|
||||
|
||||
Reference in New Issue
Block a user