release.sh: retry served-HTML checks during the post-deploy container swap
A fetch seconds after 'App is updated' can come back empty while the container recreates, which false-negatived the x-coop-build check on the 1.4.5 deploy (2026-10-26). http_body retries 3x before declaring failure.
This commit is contained in:
1 parent
91b274969b
commit
aca430cea6
1 file changed
+15
-2
+15
-2
@@ -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.
|
||||
|
||||
Reference in new issue
Block a user