forked from mtusi2026/mtusi2026lab4
feat(lab4): MinIO S3 private bucket, streaming image validation, attachment endpoints, Grade 5 Track 2 reconciler
This commit is contained in:
Executable
+25
@@ -0,0 +1,25 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
|
||||
: "${TARGET_INSTANCE_ID:?test provides target API instance alias}"
|
||||
|
||||
SCRIPT_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
|
||||
ROOT_DIR=$(CDPATH= cd -- "$SCRIPT_DIR/.." && pwd)
|
||||
cd "$ROOT_DIR"
|
||||
|
||||
TARGET_CID=""
|
||||
for cid in $(docker compose --env-file .env ps -q api); do
|
||||
short_id=$(printf '%s' "$cid" | cut -c1-12)
|
||||
hostname_val=$(docker inspect -f '{{.Config.Hostname}}' "$cid" 2>/dev/null || true)
|
||||
if [ "$short_id" = "$TARGET_INSTANCE_ID" ] || [ "$cid" = "$TARGET_INSTANCE_ID" ] || [ "$hostname_val" = "$TARGET_INSTANCE_ID" ]; then
|
||||
TARGET_CID="$cid"
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
if [ -z "$TARGET_CID" ]; then
|
||||
printf 'API container matching X-Instance-Id=%s not found\n' "$TARGET_INSTANCE_ID" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
docker stop -t 5 "$TARGET_CID" >/dev/null
|
||||
Reference in New Issue
Block a user