forked from mtusi2026/mtusi2026lab3
Балансировка, реплики, идемпотентность
This commit is contained in:
Executable
+15
@@ -0,0 +1,15 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
TARGET="${TARGET_INSTANCE_ID:?TARGET_INSTANCE_ID not set}"
|
||||
|
||||
for container in $(docker ps --filter "name=mtusi2026lab3-api-" --format "{{.Names}}"); do
|
||||
if docker logs "$container" 2>&1 | grep -q "INSTANCE_ID=$TARGET"; then
|
||||
echo "[stop-one] stopping $container (instance=$TARGET)"
|
||||
docker stop "$container"
|
||||
exit 0
|
||||
fi
|
||||
done
|
||||
|
||||
echo "[stop-one] no container found for INSTANCE_ID=$TARGET" >&2
|
||||
exit 1
|
||||
Reference in New Issue
Block a user