forked from mtusi2026/mtusi2026lab2
реализован уровень 4
This commit is contained in:
Executable
+29
@@ -0,0 +1,29 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
|
||||
project_root=$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd)
|
||||
cd "$project_root"
|
||||
|
||||
env_file=${ENV_FILE:-.env}
|
||||
|
||||
case "${SESSION_TTL_ACTION:-}" in
|
||||
short)
|
||||
ttl=${SHORT_SESSION_TTL_SECONDS:-2}
|
||||
case "$ttl" in
|
||||
''|*[!0-9]*|0)
|
||||
echo "SHORT_SESSION_TTL_SECONDS must be a positive integer" >&2
|
||||
exit 2
|
||||
;;
|
||||
esac
|
||||
SESSION_TTL_SECONDS="$ttl" docker compose --env-file "$env_file" \
|
||||
up -d --no-deps --force-recreate --wait api
|
||||
;;
|
||||
restore)
|
||||
docker compose --env-file "$env_file" \
|
||||
up -d --no-deps --force-recreate --wait api
|
||||
;;
|
||||
*)
|
||||
echo "SESSION_TTL_ACTION must be short or restore" >&2
|
||||
exit 2
|
||||
;;
|
||||
esac
|
||||
Reference in New Issue
Block a user