added token support
This commit is contained in:
@@ -33,12 +33,21 @@ if [ ! -d "/var/www/html/.git" ]; then
|
|||||||
# Pull down code from git for our site!
|
# Pull down code from git for our site!
|
||||||
if [ ! -z "$GIT_REPO" ]; then
|
if [ ! -z "$GIT_REPO" ]; then
|
||||||
# Remove the test index file
|
# Remove the test index file
|
||||||
rm -Rf /var/www/html/index.php
|
rm -Rf /var/www/html/index.html
|
||||||
if [ ! -z "$GIT_BRANCH" ]; then
|
if [ ! -z "$GIT_BRANCH" ]; then
|
||||||
git clone -b $GIT_BRANCH $GIT_REPO /var/www/html
|
if [ -z "$GIT_USERNAME" ] && [ -z "$GIT_PERSONAL_TOKEN" ]; then
|
||||||
|
git clone -b $GIT_BRANCH $GIT_REPO /var/www/html/
|
||||||
else
|
else
|
||||||
git clone $GIT_REPO /var/www/html
|
git clone -b ${GIT_BRANCH} https://${GIT_USERNAME}:${GIT_PERSONAL_TOKEN}@${GIT_REPO} /var/www/html
|
||||||
fi
|
fi
|
||||||
|
else
|
||||||
|
if [ -z "$GIT_USERNAME" ] && [ -z "$GIT_PERSONAL_TOKEN" ]; then
|
||||||
|
git clone $GIT_REPO /var/www/html/
|
||||||
|
else
|
||||||
|
git clone https://${GIT_USERNAME}:${GIT_PERSONAL_TOKEN}@${GIT_REPO} /var/www/html
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
chown -Rf nginx.nginx /var/www/html
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user