File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change 55mkdir -p -m 0700 /root/.ssh
66echo -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+
812if [ ! -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
You can’t perform that action at this time.
0 commit comments