chore(migrate) moved codebase from lab4

This commit is contained in:
Mikhail Verkovykh
2026-11-14 23:17:36 +03:00
parent 276dbdad8a
commit 28d68dc30b
123 changed files with 11677 additions and 0 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