Files
mtusi2026lab5-fork/scripts/stop-one.sh

11 lines
675 B
Bash
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/bin/sh
# Hook для make test-failover: останавливает ОДНУ API-реплику, которую тест передал
# в TARGET_INSTANCE_ID (= X-Instance-Id = hostname контейнера = короткий ID), и
# оставляет её остановленной. По умолчанию graceful (docker stop: SIGTERM ->
# осушение 3 с -> graceful shutdown); STOP_MODE=kill — «падение» (SIGKILL).
# БД, Redis, S3, LB и volumes не трогает. Восстановление: python3 scripts/ops.py restore
set -eu
cd "$(dirname "$0")/.."
PY=$(command -v python3 || command -v python)
exec "$PY" scripts/ops.py stop-one