diff options
| author | Chia <Chia@93.nz> | 2026-08-05 00:26:25 +1200 |
|---|---|---|
| committer | Chia <Chia@93.nz> | 2026-08-05 00:33:31 +1200 |
| commit | 1a3d7f9a8a181df48f0e911cbe17a3fad3ab9ac9 (patch) | |
| tree | 8c92e1e7326fc67ed077a0a878697f1be14b43da /scripts/stop-debug.sh | |
| parent | 5b651488b081b65fda8a323f228e139adb79a35d (diff) | |
add some scriptsmain
Diffstat (limited to '')
| -rwxr-xr-x | scripts/stop-debug.sh | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/scripts/stop-debug.sh b/scripts/stop-debug.sh new file mode 100755 index 0000000..8976d2c --- /dev/null +++ b/scripts/stop-debug.sh @@ -0,0 +1,27 @@ +#!/usr/bin/env bash + +set -euo pipefail + +script_dir="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)" +repo_dir="$(cd -- "$script_dir/.." && pwd)" +env_file="${AIGW_DEBUG_ENV_FILE:-$repo_dir/.env.debug}" + +command -v docker >/dev/null 2>&1 || { + printf '[aigw-debug] error: docker is not installed\n' >&2 + exit 1 +} + +if [[ -f "$env_file" ]]; then + compose=(docker compose --env-file "$env_file") +else + export AIGW_CREDENTIAL_KEY=debug-stop-placeholder + export AIGW_ADMIN_TOKEN=debug-stop-placeholder + export AIGW_STRIPE_API_KEY=debug-stop-placeholder + export AIGW_STRIPE_WEBHOOK_SECRET=debug-stop-placeholder + compose=(docker compose) +fi + +cd "$repo_dir" +printf '[aigw-debug] stopping services\n' +"${compose[@]}" down --remove-orphans +printf '[aigw-debug] stopped; PostgreSQL and Redis volumes were preserved\n' |
