Adding a check to stop pull of code if its already there
This commit is contained in:
@@ -20,10 +20,12 @@ if [ ! -z "$GIT_NAME" ]; then
|
|||||||
git config --global push.default simple
|
git config --global push.default simple
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Dont pull code down if the .git folder exists
|
||||||
|
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
|
||||||
rm -Rf /var/www/html
|
# Remove the test index file
|
||||||
mkdir /var/www/html
|
rm -Rf /var/www/html/index.php
|
||||||
if [ ! -z "$GIT_BRANCH" ]; then
|
if [ ! -z "$GIT_BRANCH" ]; then
|
||||||
git clone -b $GIT_BRANCH $GIT_REPO /var/www/html/
|
git clone -b $GIT_BRANCH $GIT_REPO /var/www/html/
|
||||||
else
|
else
|
||||||
@@ -31,6 +33,7 @@ if [ ! -z "$GIT_REPO" ]; then
|
|||||||
fi
|
fi
|
||||||
chown -Rf nginx.nginx /var/www/html
|
chown -Rf nginx.nginx /var/www/html
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
# Display PHP error's or not
|
# Display PHP error's or not
|
||||||
if [[ "$ERRORS" != "1" ]] ; then
|
if [[ "$ERRORS" != "1" ]] ; then
|
||||||
|
|||||||
Reference in New Issue
Block a user