forked from mtusi2026/mtusi2026lab4
15 lines
431 B
Bash
15 lines
431 B
Bash
#!/bin/sh
|
|
set -eu
|
|
|
|
: "${TARGET_INSTANCE_ID:?test provides target API instance alias}"
|
|
|
|
# Проверяем, что нам передали api-1 или api-2
|
|
if [ "$TARGET_INSTANCE_ID" != "api-1" ] && [ "$TARGET_INSTANCE_ID" != "api-2" ]; then
|
|
echo "Unknown instance: $TARGET_INSTANCE_ID" >&2
|
|
exit 1
|
|
fi
|
|
|
|
SERVICE_NAME="$TARGET_INSTANCE_ID"
|
|
|
|
echo "Stopping container for $SERVICE_NAME..."
|
|
docker compose stop "$SERVICE_NAME" |