This commit is contained in:
Ric Harvey
2017-01-06 09:22:18 +00:00
parent ab955ee84f
commit 00b51479e9
2 changed files with 5 additions and 5 deletions

View File

@@ -11,5 +11,5 @@ if [ -z "$GIT_NAME" ]; then
fi fi
cd /var/www/html cd /var/www/html
git pull git pull || exit 1
chown -Rf nginx:nginx /var/www/html chown -Rf nginx:nginx /var/www/html

View File

@@ -36,15 +36,15 @@ if [ ! -d "/var/www/html/.git" ]; then
rm -Rf /var/www/html/* rm -Rf /var/www/html/*
if [ ! -z "$GIT_BRANCH" ]; then if [ ! -z "$GIT_BRANCH" ]; then
if [ -z "$GIT_USERNAME" ] && [ -z "$GIT_PERSONAL_TOKEN" ]; then if [ -z "$GIT_USERNAME" ] && [ -z "$GIT_PERSONAL_TOKEN" ]; then
git clone -b $GIT_BRANCH $GIT_REPO /var/www/html/ git clone -b $GIT_BRANCH $GIT_REPO /var/www/html/ || exit 1
else else
git clone -b ${GIT_BRANCH} https://${GIT_USERNAME}:${GIT_PERSONAL_TOKEN}@${GIT_REPO} /var/www/html git clone -b ${GIT_BRANCH} https://${GIT_USERNAME}:${GIT_PERSONAL_TOKEN}@${GIT_REPO} /var/www/html || exit 1
fi fi
else else
if [ -z "$GIT_USERNAME" ] && [ -z "$GIT_PERSONAL_TOKEN" ]; then if [ -z "$GIT_USERNAME" ] && [ -z "$GIT_PERSONAL_TOKEN" ]; then
git clone $GIT_REPO /var/www/html/ git clone $GIT_REPO /var/www/html/ || exit 1
else else
git clone https://${GIT_USERNAME}:${GIT_PERSONAL_TOKEN}@${GIT_REPO} /var/www/html git clone https://${GIT_USERNAME}:${GIT_PERSONAL_TOKEN}@${GIT_REPO} /var/www/html || exit 1
fi fi
fi fi
chown -Rf nginx.nginx /var/www/html chown -Rf nginx.nginx /var/www/html