diff --git a/.gitea/workflows/ci.yaml b/.gitea/workflows/ci.yaml index 99880c1..e81e94e 100644 --- a/.gitea/workflows/ci.yaml +++ b/.gitea/workflows/ci.yaml @@ -399,6 +399,13 @@ jobs: mkdir -p "$conf" cp -r caddy otelcol prometheus tempo grafana blackbox "$conf"/ export SCRABBLE_CONFIG_DIR="$conf" + # Maintenance page for the redeploy window, mirroring prod-deploy.sh so the SPA + # overlay is exercised on the test contour too (not only prod). Raised just before + # the recreate and lowered once caddy is back (below); the trap clears it if the + # step fails so the contour never sticks in maintenance (and the reseed above wipes a + # stale flag anyway). The caddy-routed probes run in the NEXT step, after it is lowered. + maint_flag="$conf/caddy/on" + trap 'rm -f "$maint_flag"' EXIT # Derive the public URLs from the one canonical origin instead of storing each as # its own variable (paths are structural SPA routes / the Caddy /_gm sub-path). # Exported before build so the VK ID redirect is baked into the SPA. @@ -430,12 +437,23 @@ jobs: # bot on its own host instead (deploy/docker-compose.bot.yml), and the prod # main host omits both. Without the profile they would not start here. docker compose --ansi never --profile telegram-local build --progress plain + # Raise the maintenance page, THEN bring caddy onto the reseeded config mount so it + # actually carries the flag: the running caddy sits on the stale pre-reseed mount (the + # dir was rm'd + recreated — see the force-recreate note below), so a flag written to + # the new dir is invisible until caddy is recreated. With the fresh caddy up, an open + # SPA sees the 503 marker + overlay for the whole recreate window, not a bare reconnect. + : > "$maint_flag" + docker compose --ansi never up -d --force-recreate --no-deps caddy docker compose --ansi never --profile telegram-local up -d --remove-orphans # The config-only services bind-mount the reseeded config dir. A plain `up -d` # leaves them on the previous bind mount (the dir was rm'd + recreated), so a - # changed Caddyfile or Grafana dashboard is ignored — force-recreate them to - # pick up the fresh config. - docker compose --ansi never up -d --force-recreate --no-deps caddy otelcol prometheus tempo grafana + # changed Grafana dashboard is ignored — force-recreate them to pick up the fresh + # config. (Caddy was already recreated above so it would carry the maintenance flag.) + docker compose --ansi never up -d --force-recreate --no-deps otelcol prometheus tempo grafana + # Lower the maintenance page: services are back. An open SPA's poll now gets through + # (once the gateway finishes booting) and reloads into the fresh client; the caddy + # probes in the next step see 200. The EXIT trap is a backstop if we failed earlier. + rm -f "$maint_flag" - name: Probe the landing, gateway and backend run: |