Files
mtusi2026lab3/scripts/stop-one.sh
T

12 lines
441 B
Bash

#!/bin/sh
# Stop exactly ONE API replica selected by TARGET_INSTANCE_ID and leave it stopped.
# Used by tests/resilience.py failover scenario.
set -eu
: "${TARGET_INSTANCE_ID:?test provides target API instance alias}"
# Resolve compose project directory regardless of invocation cwd.
cd "$(dirname "$0")/.."
# INSTANCE_ID values are the compose service names (api-1, api-2, ...).
exec docker compose stop --timeout 5 "$TARGET_INSTANCE_ID"