chore(app) migrated lab3 files

This commit is contained in:
imadev
2026-10-31 20:10:31 +03:00
parent ec540a1a72
commit 68968c4a3a
51 changed files with 3101 additions and 2 deletions
+20
View File
@@ -0,0 +1,20 @@
#!/bin/sh
set -eu
: "${TARGET_INSTANCE_ID:?test provides target API instance alias}"
cd "$(dirname "$0")/.."
target=""
for id in $(docker compose --env-file .env ps -q api); do
hostname=$(docker inspect -f '{{.Config.Hostname}}' "$id")
if [ "$hostname" = "$TARGET_INSTANCE_ID" ]; then
target="$id"
break
fi
done
if [ -z "$target" ]; then
echo "no running API replica has instance id $TARGET_INSTANCE_ID" >&2
exit 2
fi
docker stop --time 5 "$target" >/dev/null