forked from mtusi2026/mtusi2026lab3
[+] Completed lab 3
This commit is contained in:
Executable
+14
@@ -0,0 +1,14 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
cd "$(dirname "$0")/.."
|
||||
|
||||
if [ -e .env ]; then
|
||||
printf '%s\n' 'Using existing .env'
|
||||
exit 0
|
||||
fi
|
||||
|
||||
umask 077
|
||||
set -C
|
||||
password=$(python3 -c 'import secrets; print(secrets.token_hex(24))')
|
||||
sed "s/^POSTGRES_PASSWORD=$/POSTGRES_PASSWORD=$password/" .env.example > .env
|
||||
printf '%s\n' 'Created .env for the local stand'
|
||||
Executable → Regular
Executable
+8
@@ -0,0 +1,8 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
cd "$(dirname "$0")/.."
|
||||
|
||||
docker compose ps
|
||||
docker compose down
|
||||
docker compose up -d --no-build --wait --wait-timeout 55
|
||||
docker compose ps
|
||||
Executable → Regular
Executable
+11
@@ -0,0 +1,11 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
cd "$(dirname "$0")/.."
|
||||
|
||||
case "${TARGET_INSTANCE_ID:-}" in
|
||||
api-a|api-b) service=$TARGET_INSTANCE_ID ;;
|
||||
*) printf '%s\n' 'TARGET_INSTANCE_ID must be api-a or api-b' >&2; exit 2 ;;
|
||||
esac
|
||||
|
||||
docker compose stop -t 5 "$service"
|
||||
docker compose ps --all "$service"
|
||||
Reference in New Issue
Block a user