From d054cea37febd5cbd10bce9d190995afc33b1401 Mon Sep 17 00:00:00 2001 From: kk10 Date: Sat, 17 Oct 2026 23:54:11 +0300 Subject: [PATCH] feat(scripts): add stop-one.sh for api replica failover test --- scripts/stop-one.sh | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100755 scripts/stop-one.sh diff --git a/scripts/stop-one.sh b/scripts/stop-one.sh new file mode 100755 index 00000000..b7f8570f --- /dev/null +++ b/scripts/stop-one.sh @@ -0,0 +1,8 @@ +#!/bin/sh +set -eu +: "${TARGET_INSTANCE_ID:?test provides target API instance alias}" + +service=$(docker inspect -f '{{index .Config.Labels "com.docker.compose.service"}}' "$TARGET_INSTANCE_ID") +[ "$service" = "api" ] || { echo "not an api container" >&2; exit 1; } + +docker stop -t 5 "$TARGET_INSTANCE_ID" >/dev/null