-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathentrypoint.sh
More file actions
32 lines (27 loc) · 985 Bytes
/
entrypoint.sh
File metadata and controls
32 lines (27 loc) · 985 Bytes
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
#! /usr/bin/env bash
envvars=('PORT_PASSWORD_FORMAT' 'GIT_USER_NAME' 'GIT_USER_EMAIL')
for e in ${envvars[@]}; do
if [[ -z ${!e} ]]; then
echo "Error: $e not found in the environment."
exit 1
fi
done
if [[ -n $CCC_INVENTORY_SSHKEY ]]; then
echo -e $CCC_INVENTORY_SSHKEY > ~/id
chmod 600 ~/id
export GIT_SSH_COMMAND="ssh -i ~/id -oStrictHostKeyChecking=accept-new"
unset CCC_INVENTORY_SSHKEY # doesn't work for docker exec
fi
git config --global user.name "$GIT_USER_NAME"
git config --global user.email "$GIT_USER_EMAIL"
if [[ -e /opt/ccc-inventory/.git ]]; then
echo "Found provided /opt/ccc-inventory"
else
if [[ -z $CCC_INVENTORY || -z $CCC_INVENTORY_BRANCH ]]; then
echo 'When /opt/ccc-inventory is not provided, $CCC_INVENTORY and $CCC_INVENTORY_BRANCH must be set.'
exit 1
fi
git clone -b $CCC_INVENTORY_BRANCH $CCC_INVENTORY /opt/ccc-inventory || exit 1
fi
cron
exec python3 -m streamlit run index.py