This commit is contained in:
Матвей
2026-10-20 15:13:41 +03:00
parent ec540a1a72
commit 3b52b91fb7
27 changed files with 1916 additions and 1 deletions
+7
View File
@@ -0,0 +1,7 @@
#!/bin/sh
set -eu
cd "$(dirname "$0")/.."
docker compose restart postgres
docker compose up -d --wait postgres
docker compose restart api-a api-b load_balancer
docker compose up -d --wait api-a api-b load_balancer
+18
View File
@@ -0,0 +1,18 @@
#!/bin/sh
set -eu
: "${TARGET_INSTANCE_ID:?test provides target API instance alias}"
cd "$(dirname "$0")/.."
for service in api-a api-b; do
container="$(docker compose ps -q "$service")"
[ -n "$container" ] || continue
hostname="$(docker inspect --format '{{.Config.Hostname}}' "$container")"
if [ "$hostname" = "$TARGET_INSTANCE_ID" ]; then
docker compose stop "$service"
exit 0
fi
done
printf '%s\n' 'TARGET_INSTANCE_ID does not match a running API replica' >&2
exit 2