diff --git a/deploy/redeploy-hub.sh b/deploy/redeploy-hub.sh index 8e41da3..5621801 100755 --- a/deploy/redeploy-hub.sh +++ b/deploy/redeploy-hub.sh @@ -66,11 +66,18 @@ rollback() { echo "πŸ›‘ redeploy FAILED β€” rolled back to the previous binary"; exit 1 } curl --retry 20 --retry-connrefused --retry-delay 1 --max-time 25 -sf "$URL/metrics" >/dev/null || rollback -code=$(curl -s -o /dev/null -w '%{http_code}' -X POST "$URL/v1/invite/revoke") -[ "$code" = 401 ] || { echo " βœ— /v1/invite/revoke = $code (want 401 β€” new code not live)"; rollback; } -echo " βœ“ /v1/invite/revoke present (401 unauth) β€” P2 code is LIVE" +# Marker: /healthz is the clean oldβ†’new discriminator β€” the pre-round-1 hub 404s +# it, the new code returns 200 "ok ". (invite/revoke is already 401 on the +# live M8a hub, so it can no longer prove the swap took.) +code=$(curl -s -o /dev/null -w '%{http_code}' "$URL/healthz") +[ "$code" = 200 ] || { echo " βœ— /healthz = $code (want 200 β€” new code not live; the old hub 404s it)"; rollback; } +echo " βœ“ /healthz present (200) β€” new hub code is LIVE: $(curl -s --max-time 5 "$URL/healthz")" +# /readyz pings the DB β€” proves the metadata store opened post-migration. +rcode=$(curl -s -o /dev/null -w '%{http_code}' "$URL/readyz") +[ "$rcode" = 200 ] || { echo " βœ— /readyz = $rcode (DB not ready)"; rollback; } +echo " βœ“ /readyz present (200) β€” metadata DB is reachable" say "πŸ”’ post-deploy counts (compare to pre β€” device/share/chunk should match)" echo "$(counts)" -say "βœ… hub redeployed safely β€” P2 (+s attenuation Β· invite revocation) + P3 (gc-every) are live." +say "βœ… hub redeployed safely β€” 7 rounds live (push-verify, HTTP_PROXY fix, backup⇄gc flock, fsck, /healthz+/readyz, /metrics counters, device/share ls, …)."