28 lines
887 B
Bash
28 lines
887 B
Bash
#!/bin/sh
|
|
# Separate short-TTL stand used by `make test-ttl`.
|
|
# It is a distinct Compose project on its own port with its own disposable
|
|
# volumes, so the main stand and its synthetic data are untouched.
|
|
set -eu
|
|
cd "$(dirname "$0")/.."
|
|
|
|
PROJECT="${TTL_PROJECT:-mtusi-lab2-ttl}"
|
|
PORT="${TTL_PORT:-8081}"
|
|
ACTION="${1:-}"
|
|
|
|
case "$ACTION" in
|
|
start)
|
|
SESSION_TTL_SECONDS=2 API_PUBLISH_PORT="$PORT" \
|
|
docker compose -p "$PROJECT" --env-file .env up -d --wait --wait-timeout 180
|
|
printf 'ttl_stack_ready base_url=http://127.0.0.1:%s session_ttl_seconds=2\n' "$PORT"
|
|
;;
|
|
stop)
|
|
# -v removes only this dedicated synthetic stand's volumes.
|
|
docker compose -p "$PROJECT" --env-file .env down -v --timeout 10
|
|
printf 'ttl_stack_removed\n'
|
|
;;
|
|
*)
|
|
printf 'usage: %s start|stop\n' "$0" >&2
|
|
exit 2
|
|
;;
|
|
esac
|