forked from UAMS-DBMI/PosdaTools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
manage
executable file
·64 lines (53 loc) · 1.3 KB
/
manage
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/usr/bin/env bash
set -e
help() {
echo "Posda Docker Edition (DE) Management Script
This script is intended for use mainly in development environments,
and as such all commands operate using the dev docker-compose file.
Supported operations:
help - this help
up - bring up all containers via docker-compose
specify -d to detatch (attached by default)
down - bring down all containers via docker-compose
restart - restart containers without removing
psql - execute the PostgreSQL shell inside the running db container
shell - open a Posda Shell inside the main Posda container
logs - open and follow the full logs
"
}
case "$1" in
restart)
shift
git describe --tags > posda/posdatools/versionInfo.txt
exec docker-compose restart $*
;;
up)
shift
make -C posda posdatools/posda.env
git describe --tags > posda/posdatools/versionInfo.txt
exec docker-compose up $*
;;
down)
shift
exec docker-compose down $*
;;
psql)
shift
exec docker-compose exec db psql -U postgres $*
;;
shell)
shift
exec docker-compose exec posda bash -c 'cd /home/posda/posdatools; ./posda_shell'
;;
logs)
shift
exec docker-compose logs -f --tail=10
;;
help)
shift
help
;;
*)
help
;;
esac