выполнение на 5
This commit is contained in:
Executable
+19
@@ -0,0 +1,19 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
cd "$(dirname "$0")/.."
|
||||
: "${TARGET_INSTANCE_ID:?test provides target API instance alias}"
|
||||
|
||||
found=
|
||||
for container_id in $(docker compose ps --quiet --status running api); do
|
||||
hostname=$(docker inspect --format '{{.Config.Hostname}}' "$container_id")
|
||||
if [ "$hostname" = "$TARGET_INSTANCE_ID" ]; then
|
||||
found=$container_id
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
if [ -z "$found" ]; then
|
||||
printf '%s\n' 'No running API container matched the requested instance alias.' >&2
|
||||
exit 1
|
||||
fi
|
||||
docker stop --time 5 "$found" >/dev/null
|
||||
Reference in New Issue
Block a user