ЛР 3 — БВТ-2302 — Сабитов — на 3

This commit is contained in:
2026-12-01 18:09:13 +03:00
parent 0ab3a341aa
commit d79bf5c481
36 changed files with 1944 additions and 36 deletions
+16
View File
@@ -0,0 +1,16 @@
#!/bin/sh
set -eu
cd "$(dirname "$0")/.."
case "${TARGET_INSTANCE_ID:-}" in api1|api2) ;; *) exit 2 ;; esac
id=$(docker compose --env-file .env ps -a -q "$TARGET_INSTANCE_ID")
test "$(docker inspect --format '{{.State.Running}}' "$id")" = false
for service in db lb api1 api2; do
test "$service" = "$TARGET_INSTANCE_ID" && continue
id=$(docker compose --env-file .env ps -q "$service")
test -n "$id"
test "$(docker inspect --format '{{.State.Running}}' "$id")" = true
done
echo "PASS: $TARGET_INSTANCE_ID really stopped; the other API, LB and database stayed running"
docker compose --env-file .env up -d --wait --wait-timeout 60 "$TARGET_INSTANCE_ID"
# Wait for HAProxy's next successful check; do not assume Compose health is LB health.
python3 scripts/wait_replicas.py