Files
mtusi2026lab7/scripts/stop-one.sh
T
sxdees 2f2047909f
Skeleton contracts / contracts (pull_request) Blocked by required conditions
ЛР7 на 4: HTTPS, mTLS, OpenBao AppRole и ротация leaf.
Smoke/security/grade4/persistence/failover пройдены; REPORT и DEFENSE.
2026-12-02 23:08:27 +03:00

12 lines
590 B
Bash
Executable File

#!/bin/sh
set -eu
. "$(dirname "$0")/_lib.sh"
: "${TARGET_INSTANCE_ID:?test provides target API instance alias}"
service=$(docker inspect -f '{{index .Config.Labels "com.docker.compose.service"}}' "$TARGET_INSTANCE_ID" 2>/dev/null || true)
project=$(docker inspect -f '{{index .Config.Labels "com.docker.compose.project"}}' "$TARGET_INSTANCE_ID" 2>/dev/null || true)
[ "$service" = "api" ] || { echo "not an api container" >&2; exit 1; }
[ "$project" = "gavrilenko-lab7" ] || { echo "container is not from gavrilenko-lab7" >&2; exit 1; }
docker stop -t 5 "$TARGET_INSTANCE_ID" >/dev/null