-
Notifications
You must be signed in to change notification settings - Fork 4
/
run.sh
41 lines (34 loc) · 1.1 KB
/
run.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
#!/usr/bin/env bash
set -e
if [ ! -e /root/.config/quasar/quasar-config.json ]; then
echo >&2 'info: create quasar-config.json'
PORT="${PORT-8080}"
OIDC_ISSUER="${OIDC_ISSUER}"
OIDC_CLIENT_ID="${OIDC_CLIENT_ID}"
OIDC_NAME="${OIDC_NAME-OpenIDConnect}"
echo "
{
\"server\": {
\"port\": $PORT
},
\"authentication\": {
\"openid_providers\": [
{
\"issuer\": \"$OIDC_ISSUER\",
\"client_id\": \"$OIDC_CLIENT_ID\",
\"display_name\": \"$OIDC_NAME\"
}
]
}
}
" >> /root/.config/quasar/quasar-config.json
fi
set -e
export _JAVA_OPTIONS="${JAVA_OPTIONS:="-Xms1G -Xmx4G "} $SD_OPTS"
# Initialise Advanced Metastore if required
if [ ! -e /root/.config/quasar/quasar-metastore.db.mv.db ]; then
[ -z "$ADMIN_GROUP" ] && { echo "Need to set ADMIN_GROUP"; exit 1; }
[ -z "$ADMIN_USERS" ] && { echo "Need to set ADMIN_USERS"; exit 1; }
java -jar /slamdata-backend.jar bootstrap --admin-group $ADMIN_GROUP --admin-users $ADMIN_USERS
fi
java -server -jar /slamdata-backend.jar --content-path /public