Skip to content

Commit 869483e

Browse files
author
Ric Harvey
committed
fixed if statement in start script
1 parent e6da096 commit 869483e

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

scripts/start.sh

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
mkdir -p -m 0700 /root/.ssh
66
echo -e "Host *\n\tStrictHostKeyChecking no\n" >> /root/.ssh/config
77

8+
if [[ "$GIT_USE_SSH" == "1" ]] ; then
9+
echo -e "Host *\n\tUser ${GIT_USERNAME}\n\n" >> /root/.ssh/config
10+
fi
11+
812
if [ ! -z "$SSH_KEY" ]; then
913
echo $SSH_KEY > /root/.ssh/id_rsa.base64
1014
base64 -d /root/.ssh/id_rsa.base64 > /root/.ssh/id_rsa
@@ -42,10 +46,11 @@ if [ ! -d "/var/www/html/.git" ]; then
4246
if [ -z "$GIT_USERNAME" ] && [ -z "$GIT_PERSONAL_TOKEN" ]; then
4347
GIT_COMMAND=${GIT_COMMAND}" ${GIT_REPO}"
4448
else
45-
if [[ "$GIT_USE_SSH" == "1" ]]; then
46-
GIT_COMMAND=${GIT_COMMAND}" ${GIT_REPO}"
47-
else
48-
GIT_COMMAND=${GIT_COMMAND}" https://${GIT_USERNAME}:${GIT_PERSONAL_TOKEN}@${GIT_REPO}"
49+
if [[ "$GIT_USE_SSH" == "1" ]]; then
50+
GIT_COMMAND=${GIT_COMMAND}" ${GIT_REPO}"
51+
else
52+
GIT_COMMAND=${GIT_COMMAND}" https://${GIT_USERNAME}:${GIT_PERSONAL_TOKEN}@${GIT_REPO}"
53+
fi
4954
fi
5055
${GIT_COMMAND} /var/www/html || exit 1
5156
chown -Rf nginx.nginx /var/www/html

0 commit comments

Comments
 (0)