-
Notifications
You must be signed in to change notification settings - Fork 0
/
run-env.sh
executable file
·40 lines (28 loc) · 939 Bytes
/
run-env.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/bash
set -e
profile=""
if [[ "${1}" == "full" ]]; then
profile="--profile full"
fi
function teardown() {
# shellcheck disable=SC2086
docker compose ${profile} down --remove-orphans --volumes
}
trap teardown exit
# shellcheck disable=SC2086
docker compose pull
# shellcheck disable=SC2086
docker compose ${profile} build
if ! docker compose up -d; then
# shellcheck disable=SC2086
docker compose ${profile} logs -t migrate
echo "error: docker compose up failed; scroll up for logs"
exit 1
fi
docker compose exec -it postgres psql -U postgres -c 'ALTER SYSTEM SET wal_level = logical;'
# docker compose exec -it postgres psql -U postgres -c "ALTER DATABASE camry SET log_statement = 'all';"
docker compose restart postgres
# shellcheck disable=SC2086
DJANGOLANG_PROFILE="${DJANGOLANG_PROFILE:-0}" docker compose ${profile} up -d
# shellcheck disable=SC2086
docker compose ${profile} logs -f -t