Complete lab 7 TLS and secret management
Skeleton contracts / contracts (pull_request) Canceled after 0s
Skeleton contracts / contracts (pull_request) Canceled after 0s
This commit is contained in:
Executable
+15
@@ -0,0 +1,15 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
cd "$(dirname "$0")/.."
|
||||
: "${TARGET_INSTANCE_ID:?TARGET_INSTANCE_ID is required}"
|
||||
for service in api1 api2; do
|
||||
cid=$(docker compose ps -q "$service")
|
||||
[ -n "$cid" ] || continue
|
||||
identity=$(docker inspect --format '{{range .Config.Env}}{{println .}}{{end}}' "$cid" | sed -n 's/^APP_INSTANCE_ID=//p')
|
||||
if [ "$identity" = "$TARGET_INSTANCE_ID" ]; then
|
||||
docker compose stop -t 2 "$service"
|
||||
exit 0
|
||||
fi
|
||||
done
|
||||
echo 'Target instance not found' >&2
|
||||
exit 1
|
||||
Reference in New Issue
Block a user