Adding a check to stop pull of code if its already there

This commit is contained in:
Ric Harvey
2016-06-30 11:30:40 +01:00
parent 2a8206d602
commit 8d2f1091d1

View File

@@ -20,16 +20,19 @@ if [ ! -z "$GIT_NAME" ]; then
git config --global push.default simple
fi
# Pull down code from git for our site!
if [ ! -z "$GIT_REPO" ]; then
rm -Rf /var/www/html
mkdir /var/www/html
if [ ! -z "$GIT_BRANCH" ]; then
git clone -b $GIT_BRANCH $GIT_REPO /var/www/html/
else
git clone $GIT_REPO /var/www/html/
fi
chown -Rf nginx.nginx /var/www/html
# Dont pull code down if the .git folder exists
if [ ! -d "/var/www/html/.git" ]; then
# Pull down code from git for our site!
if [ ! -z "$GIT_REPO" ]; then
# Remove the test index file
rm -Rf /var/www/html/index.php
if [ ! -z "$GIT_BRANCH" ]; then
git clone -b $GIT_BRANCH $GIT_REPO /var/www/html/
else
git clone $GIT_REPO /var/www/html/
fi
chown -Rf nginx.nginx /var/www/html
fi
fi
# Display PHP error's or not