diff --git a/release.sh b/release.sh index 6dcdb6f..f85d68c 100755 --- a/release.sh +++ b/release.sh @@ -38,6 +38,17 @@ need_token() { : "${CLOUDRON_TOKEN:?export CLOUDRON_TOKEN first (set -a; . ~/.he cr() { cloudron --server "$SERVER" --token "$CLOUDRON_TOKEN" "$@"; } manifest_tag() { python3 -c "import json;print(json.load(open('$MANIFEST'))['dockerImage'].rsplit(':',1)[-1])"; } +# curl with retries: right after a deploy the container is mid-swap and a fetch +# can return empty — that false-negatives the served-HTML checks. +http_body() { + local url=$1 try out="" + for try in 1 2 3; do + out=$(curl -sf -m 20 "$url" 2>/dev/null) && { printf '%s' "$out"; return 0; } + sleep 3 + done + return 1 +} + cmd_build() { # Builds are REMOTE: the CLI uploads the build context and the registry app's # BuildKit does the work (no docker on the caller). What is required is a @@ -122,10 +133,12 @@ cmd_verify() { [ "$css_repo" = "$css_live" ] && ok "container custom.css == repo (no stale build cache)" \ || bad "container custom.css $css_live != repo $css_repo (stale COPY layer — rebuild --no-cache)" - local html; html=$(curl -s "https://chat.inference.coop/login") + local html; html=$(http_body "https://chat.inference.coop/login") grep -qE 'assets/custom\.css' <<<"$html" && ok "served HTML links custom.css" || bad "served HTML missing custom.css link" grep -qE 'assets/custom2\.js' <<<"$html" && ok "served HTML links custom2.js" || bad "served HTML missing custom2.js link" - curl -s "https://chat.inference.coop/" | grep -qE 'x-coop-build' && ok "x-coop-build marker present" \ + # NOTE: right after `deploy` the container is mid-swap; a curl can come back + # empty and false-negative. The retry in http_body exists for that (seen 2026-10-26). + http_body "https://chat.inference.coop/" | grep -qE 'x-coop-build' && ok "x-coop-build marker present" \ || bad "no x-coop-build marker (stale service-worker clients will not self-heal)" # The scheduler task must point at a file that exists in the RUNNING image.