ci(deploy): probe backend /readyz so a dead backend fails the deploy #94

Merged
developer merged 2 commits from feature/deploy-backend-probe into development 2026-06-20 19:04:52 +00:00
Showing only changes of commit 649b90024f - Show all commits
+12 -6
View File
@@ -299,22 +299,28 @@ jobs:
# pick up the fresh config. # pick up the fresh config.
docker compose --ansi never up -d --force-recreate --no-deps caddy otelcol prometheus tempo grafana docker compose --ansi never up -d --force-recreate --no-deps caddy otelcol prometheus tempo grafana
- name: Probe the landing and the gateway through caddy - name: Probe the landing, gateway and backend
run: | run: |
set -u set -u
# Two probes through the contour caddy: "/" is the static # Three probes. "/" is the static landing container and "/app/" the
# landing container, "/app/" is the gateway-served SPA shell. # gateway-served SPA shell (both through the contour caddy on the edge net).
# The backend /readyz is probed on the internal net as well: the caddy probes
# are blind to a crash-looping backend (the landing is static and the SPA
# shell is served without it), which let a bad deploy go green while the
# backend was down — so check it directly here.
for i in $(seq 1 20); do for i in $(seq 1 20); do
if docker run --rm --network edge alpine:3.20 wget -q -T 5 -O /dev/null http://scrabble/ && if docker run --rm --network edge alpine:3.20 wget -q -T 5 -O /dev/null http://scrabble/ &&
docker run --rm --network edge alpine:3.20 wget -q -T 5 -O /dev/null http://scrabble/app/; then docker run --rm --network edge alpine:3.20 wget -q -T 5 -O /dev/null http://scrabble/app/ &&
echo "healthy: GET http://scrabble/ (landing) + /app/ (gateway)" docker run --rm --network scrabble-internal alpine:3.20 wget -q -T 5 -O /dev/null http://backend:8080/readyz; then
echo "healthy: GET / (landing) + /app/ (gateway) + backend /readyz"
exit 0 exit 0
fi fi
sleep 3 sleep 3
done done
echo "probe failed; recent landing + gateway logs:" echo "probe failed; recent landing + gateway + backend logs:"
docker logs --tail 50 scrabble-landing || true docker logs --tail 50 scrabble-landing || true
docker logs --tail 50 scrabble-gateway || true docker logs --tail 50 scrabble-gateway || true
docker logs --tail 50 scrabble-backend || true
exit 1 exit 1
- name: Probe the Telegram connector liveness - name: Probe the Telegram connector liveness