-
Notifications
You must be signed in to change notification settings - Fork 43
/
entrypoint.sh
executable file
·42 lines (34 loc) · 1.25 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
#!/bin/bash
set -e
if [[ -z "$TACKLE_HUB_URL" ]]; then
echo "You must provide TACKLE_HUB_URL environment variable" 1>&2
exit 1
fi
if [[ $AUTH_REQUIRED != "false" ]]; then
if [[ -z "$KEYCLOAK_REALM" ]]; then
echo "You must provide KEYCLOAK_REALM environment variable" 1>&2
exit 1
fi
if [[ -z "$KEYCLOAK_CLIENT_ID" ]]; then
echo "You must provide KEYCLOAK_CLIENT_ID environment variable" 1>&2
exit 1
fi
if [[ -z "$KEYCLOAK_SERVER_URL" ]]; then
echo "You must provide KEYCLOAK_SERVER_URL environment variable" 1>&2
exit 1
fi
fi
# Copy the Kube API and service CA bundle to /opt/app-root/src/ca.crt if they exist
# Add Kube API CA
if [ -f "/var/run/secrets/kubernetes.io/serviceaccount/ca.crt" ]; then
cp /var/run/secrets/kubernetes.io/serviceaccount/ca.crt ${NODE_EXTRA_CA_CERTS}
fi
# Add service serving CA
if [ -f "/var/run/secrets/kubernetes.io/serviceaccount/service-ca.crt" ]; then
cat /var/run/secrets/kubernetes.io/serviceaccount/service-ca.crt >> ${NODE_EXTRA_CA_CERTS}
fi
# Add custom ingress CA if it exists
if [ -f "/etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem" ]; then
cat /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem >> ${NODE_EXTRA_CA_CERTS}
fi
exec node --enable-source-maps server/dist/index.js