diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index 98540c5..154d406 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -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