Add new flag REMOVE_FILES to close #121

This commit is contained in:
Ric Harvey
2017-03-16 16:29:22 +00:00
parent fb035e0955
commit aa551a999e
3 changed files with 8 additions and 3 deletions

View File

@@ -21,4 +21,4 @@ The following flags are a list of all the currently supported options that can b
- **RUN_SCRIPTS** : Set to 1 to execute scripts - **RUN_SCRIPTS** : Set to 1 to execute scripts
- **PGID** : Set to GroupId you want to use for nginx (helps permissions when using local volume) - **PGID** : Set to GroupId you want to use for nginx (helps permissions when using local volume)
- **PUID** : Set to UserID you want to use for nginx (helps permissions when using local volume) - **PUID** : Set to UserID you want to use for nginx (helps permissions when using local volume)
- **REMOVE_FILES** : Use REMOVE_FILES=0 to prevent the script from clearing out /var/www/html (useful for working with local files)

View File

@@ -21,6 +21,7 @@ The latest tag will always follow the master branch in git. the other versions w
| 1.1.3 | 1.1.3 |1.11.10 | 7.1.2 | 3.4 | 0.2.6 | | 1.1.3 | 1.1.3 |1.11.10 | 7.1.2 | 3.4 | 0.2.6 |
| 1.1.4 | 1.1.4 |1.11.10 | 7.1.2 | 3.4 | 0.2.6 | | 1.1.4 | 1.1.4 |1.11.10 | 7.1.2 | 3.4 | 0.2.6 |
| 1.1.5 | 1.1.5 |1.11.10 | 7.1.2 | 3.4 | 0.2.7 | | 1.1.5 | 1.1.5 |1.11.10 | 7.1.2 | 3.4 | 0.2.7 |
| 1.1.6 | 1.1.6 |1.11.10 | 7.1.2 | 3.4 | 0.2.8 |
These tags will be created as releases on GitHub and as tags in docker hub. These tags will be created as releases on GitHub and as tags in docker hub.

View File

@@ -36,8 +36,12 @@ fi
if [ ! -d "/var/www/html/.git" ]; then 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 if you are pulling in a git repo
if [ ! -z ${REMOVE_FILES} ] && [ ${REMOVE_FILES} == 0 ]; then
echo "skiping removal of files"
else
rm -Rf /var/www/html/* rm -Rf /var/www/html/*
fi
GIT_COMMAND='git clone ' GIT_COMMAND='git clone '
if [ ! -z "$GIT_BRANCH" ]; then if [ ! -z "$GIT_BRANCH" ]; then
GIT_COMMAND=${GIT_COMMAND}" -b ${GIT_BRANCH}" GIT_COMMAND=${GIT_COMMAND}" -b ${GIT_BRANCH}"