-
Notifications
You must be signed in to change notification settings - Fork 1
/
run-digdag.sh
executable file
·71 lines (66 loc) · 2.72 KB
/
run-digdag.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
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
initialize_environment() {
if [ -z $DIGDAG_ENCRYPTION_KEY ]; then
DIGDAG_ENCRYPTION_KEY=MDEyMzQ1Njc4OTAxMjM0NQ==
fi
if [ -z $CONFIG_FILE ]; then
CONFIG_FILE=./digdag.properties
fi
}
start_server() {
if [[ -n $POSTGRES_ENV_POSTGRES_USER && \
-n $POSTGRES_ENV_POSTGRES_PASSWORD && \
-n $POSTGRES_ENV_POSTGRES_DB && \
-n $POSTGRES_PORT_5432_TCP_ADDR && \
-n $POSTGRES_PORT_5432_TCP_PORT ]]; then
digdag server $* --bind 0.0.0.0 \
--port 65432 \
--admin-bind 0.0.0.0 \
--admin-port 65433 \
--config $CONFIG_FILE \
-X database.type=postgresql \
-X database.user=$POSTGRES_ENV_POSTGRES_USER \
-X database.password=$POSTGRES_ENV_POSTGRES_PASSWORD \
-X database.host=$POSTGRES_PORT_5432_TCP_ADDR \
-X database.port=$POSTGRES_PORT_5432_TCP_PORT \
-X database.database=$POSTGRES_ENV_POSTGRES_DB \
-X digdag.secret-encryption-key=$DIGDAG_ENCRYPTION_KEY
elif [[ -n $DB_USER && \
-n $DB_PASSWORD && \
-n $DB_NAME && \
-n $DB_HOST && \
-n $DB_PORT ]]; then
digdag server $* --bind 0.0.0.0 \
--port 65432 \
--admin-bind 0.0.0.0 \
--admin-port 65433 \
--config $CONFIG_FILE \
-X database.type=postgresql \
-X database.user=$DB_USER \
-X database.password=$DB_PASSWORD \
-X database.host=$DB_HOST \
-X database.port=$DB_PORT \
-X database.database=$DB_NAME \
-X digdag.secret-encryption-key=$DIGDAG_ENCRYPTION_KEY
elif [[ -n $DB_DIR ]]; then
digdag server $* --bind 0.0.0.0 \
--port 65432 \
--admin-bind 0.0.0.0 \
--admin-port 65433 \
--config $CONFIG_FILE \
--database $DB_DIR
else
digdag server $* --bind 0.0.0.0 \
--port 65432 \
--admin-bind 0.0.0.0 \
--admin-port 65433 \
--config $CONFIG_FILE \
--memory
fi
}
initialize_environment
if [ $# -ne 0 ]; then
echo "Starting digdag server with additional parameters $*"
else
echo "Starting digdag server with no additional parameters"
fi
start_server $*