ЛР 3 — БВТ-2302 — Сабитов — на 3
This commit is contained in:
Executable
+16
@@ -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
|
||||
Reference in New Issue
Block a user