ci(deploy): probe backend /readyz so a dead backend fails the deploy (#94)
The post-deploy probe checked only the static landing and the gateway-served SPA shell, so a crash-looping backend passed the deploy green. Add an http://backend:8080/readyz probe on the internal network (and dump backend logs on failure) so an unready backend fails the deploy loudly.
This commit was merged in pull request #94.
This commit is contained in:
@@ -299,22 +299,28 @@ jobs:
|
||||
# pick up the fresh config.
|
||||
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: |
|
||||
set -u
|
||||
# Two probes through the contour caddy: "/" is the static
|
||||
# landing container, "/app/" is the gateway-served SPA shell.
|
||||
# Three probes. "/" is the static landing container and "/app/" the
|
||||
# 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
|
||||
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
|
||||
echo "healthy: GET http://scrabble/ (landing) + /app/ (gateway)"
|
||||
docker run --rm --network edge alpine:3.20 wget -q -T 5 -O /dev/null http://scrabble/app/ &&
|
||||
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
|
||||
fi
|
||||
sleep 3
|
||||
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-gateway || true
|
||||
docker logs --tail 50 scrabble-backend || true
|
||||
exit 1
|
||||
|
||||
- name: Probe the Telegram connector liveness
|
||||
|
||||
Reference in New Issue
Block a user