From 449e4d2df37e37661cbe0821296610ccda1c682b Mon Sep 17 00:00:00 2001 From: Gelu Date: Mon, 24 Aug 2026 10:34:16 +0000 Subject: [PATCH] ci: the deploy health check must follow redirects jecreativ.ro's first production deploy went red for behaving exactly as configured: it runs in UnderConstruction mode, so `/` correctly answers 302 to the placeholder, and the check asserted a bare 200. Now `-L` follows the redirect and the FINAL code is asserted. A redirect means the app is up and routing, which is what this step is for; a real failure (502, 500, refused) still reports. The version gate itself was right throughout -- it read 1bafc14 from the production host, including through the under-construction middleware. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_01WpTYCBLH58XzrM7n3xPJ5N --- .gitea/workflows/build.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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