-
Notifications
You must be signed in to change notification settings - Fork 10
/
entrypoint.sh
executable file
·47 lines (38 loc) · 1.27 KB
/
entrypoint.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
#!/bin/bash
set -e
if [[ -z "$CONTROLS_API_URL" ]]; then
echo "You must provide CONTROLS_API_URL environment variable" 1>&2
exit 1
fi
if [[ -z "$APPLICATION_INVENTORY_API_URL" ]]; then
echo "You must provide APPLICATION_INVENTORY_API_URL environment variable" 1>&2
exit 1
fi
if [[ -z "$PATHFINDER_API_URL" ]]; then
echo "You must provide PATHFINDER_API_URL environment variable" 1>&2
exit 1
fi
if [[ -z "$SSO_REALM" ]]; then
echo "You must provide SSO_REALM environment variable" 1>&2
exit 1
fi
if [[ -z "$SSO_SERVER_URL" ]]; then
echo "You must provide SSO_SERVER_URL environment variable" 1>&2
exit 1
fi
if [[ -z "$SSO_CLIENT_ID" ]]; then
echo "You must provide SSO_CLIENT_ID environment variable" 1>&2
exit 1
fi
if [ -f ./nginx.conf.template ]; then
echo "---> Processing nginx.conf.template configuration file..."
envsubst '${CONTROLS_API_URL} ${SSO_SERVER_URL} ${APPLICATION_INVENTORY_API_URL} ${PATHFINDER_API_URL}' < ./nginx.conf.template > ./nginx.conf
cp -v ./nginx.conf "${NGINX_CONF_PATH}"
rm -f ./nginx.conf
fi
if [ -f ./keycloak.json.template ]; then
echo "---> Processing keycloak.json.template configuration file..."
envsubst '${SSO_REALM} ${SSO_CLIENT_ID}' < ./keycloak.json.template > ./keycloak.json
fi
echo "Container started"
exec "$@"