This commit is contained in:
Матвей
2026-11-07 13:15:01 +03:00
parent 20afc2c790
commit eafb825657
93 changed files with 7549 additions and 1 deletions
+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