forked from microsoft/planetary-computer-apis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconsole
executable file
·105 lines (88 loc) · 2.05 KB
/
console
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
#!/bin/bash
set -e
if [[ "${CI}" ]]; then
set -x
fi
function usage() {
echo -n \
"Usage: $(basename "$0") [--stac, --tiler, --funcs, --db, --deploy]
Runs a console in the development container
--stac - Drops into a dev stac service container. Default.
--tiler - Drops into a dev tiler service container.
--funcs - Drops into a funcs service container.
--db - Drops into a db container
--deploy - Drops into a deploy container
"
}
# Parse args
DEV_STAC_CONSOLE=1
while [[ "$#" > 0 ]]; do case $1 in
--db)
DB_CONSOLE=1
shift
;;
--stac)
DEV_STAC_CONSOLE=1
shift
;;
--tiler)
DEV_TILER_CONSOLE=1
shift
;;
--funcs)
FUNCS_CONSOLE=1
shift
;;
--deploy)
DEPLOY_CONSOLE=1
shift
;;
--help)
usage
exit 0
shift
;;
*)
usage "Unknown parameter passed: $1"
shift
shift
;;
esac done
if [ "${BASH_SOURCE[0]}" = "${0}" ]; then
if [[ "${DB_CONSOLE}" ]]; then
docker-compose \
-f docker-compose.yml \
exec database psql postgres://username:password@database:5432/postgis
exit 0
fi
if [[ "${DEV_TILER_CONSOLE}" ]]; then
docker-compose \
-f docker-compose.yml \
-f docker-compose.dev.yml \
run --rm \
tiler-dev /bin/bash
exit 0
fi
if [[ "${FUNCS_CONSOLE}" ]]; then
docker-compose \
-f docker-compose.yml \
run --rm \
funcs /bin/bash
exit 0
fi
if [[ "${DEPLOY_CONSOLE}" ]]; then
GIT_COMMIT="$(git rev-parse --short HEAD)" docker-compose \
-f deployment/docker-compose.yml \
run --rm \
deploy /bin/bash
exit 0
fi
if [[ "${DEV_STAC_CONSOLE}" ]]; then
docker-compose \
-f docker-compose.yml \
-f docker-compose.dev.yml \
run --rm \
stac-dev /bin/bash
exit 0
fi
fi