diff --git a/00-install.sh b/00-install.sh index 3a459ca..86c287e 100755 --- a/00-install.sh +++ b/00-install.sh @@ -1,6 +1,8 @@ #!/bin/bash +# For production builds change to DEBUG=0 or comment the line entirely export DEBUG=1 + SOURCE_DIR=$(realpath $(dirname "${0}")) ${SOURCE_DIR}/01-basic.sh @@ -8,3 +10,8 @@ ${SOURCE_DIR}/02-sahana.sh ${SOURCE_DIR}/03-sambro.sh ${SOURCE_DIR}/10-seeddms.sh ${SOURCE_DIR}/50-pandora.sh + +# Perform cleanup only if DEBUG environment variable is not set +if [ ${DEBUG:-0} -eq 0 ]; then + ${SOURCE_DIR}/99-cleanup.sh +fi diff --git a/01-basic.sh b/01-basic.sh index cbf16ac..236a37e 100755 --- a/01-basic.sh +++ b/01-basic.sh @@ -125,8 +125,8 @@ apt-get -y --no-install-recommends -y install postgresql-9.6 postgresql-9.6-post cp ${SOURCE_DIR}/basic/etc/postgresql/9.6/main/postgresql.conf /etc/postgresql/9.6/main/postgresql.conf cp ${SOURCE_DIR}/basic/etc/postgresql/9.6/main/pg_hba.conf /etc/postgresql/9.6/main/pg_hba.conf -# Enable query logging. Only if the DEBUG environment variable exists -if [ -n "${DEBUG}" ]; then +# Enable query logging. Only if the DEBUG environment variable is set +if [ ${DEBUG:-0} -eq 1 ]; then sed -i 's/#log_destination/log_destination/' /etc/postgresql/9.6/main/postgresql.conf sed -i 's/#logging_collector/logging_collector/' /etc/postgresql/9.6/main/postgresql.conf sed -i 's/#log_directory/log_directory/' /etc/postgresql/9.6/main/postgresql.conf diff --git a/02-sahana.sh b/02-sahana.sh index 5d8aa14..78dfabc 100755 --- a/02-sahana.sh +++ b/02-sahana.sh @@ -52,8 +52,8 @@ chown -R sahana:sahana /srv/sahana cd /srv/sahana sudo -u sahana python web2py.py -S eden -M -R applications/eden/static/scripts/tools/noop.py -# Set "production values" (increases performance). Only if the DEBUG environment variable doesn't exist -if [ -z "${DEBUG}" ]; then +# Set "production values" (increases performance) only if the DEBUG environment variable is not set +if [ ${DEBUG:-0} -eq 0 ]; then sed -i 's/settings.base.migrate = True/settings.base.migrate = False/' /srv/sahana/applications/eden/models/000_config.py sed -i 's/settings.base.debug = True/settings.base.debug = False/' /srv/sahana/applications/eden/models/000_config.py sed -i 's/#settings.base.prepopulate = 0/settings.base.prepopulate = 0/' /srv/sahana/applications/eden/models/000_config.py diff --git a/03-sambro.sh b/03-sambro.sh index b489887..08d46af 100755 --- a/03-sambro.sh +++ b/03-sambro.sh @@ -52,8 +52,8 @@ chown -R sambro:sambro /srv/sambro cd /srv/sambro sudo -u sambro python web2py.py -S eden -M -R applications/eden/static/scripts/tools/noop.py -# Set "production values" (increases performance). Only if the DEBUG environment variable doesn't exist -if [ -z "${DEBUG}" ]; then +# Set "production values" (increases performance) only if the DEBUG environment variable is not set +if [ ${DEBUG:-0} -eq 0 ]; then sed -i 's/settings.base.migrate = True/settings.base.migrate = False/' /srv/sambro/applications/eden/models/000_config.py sed -i 's/settings.base.debug = True/settings.base.debug = False/' /srv/sambro/applications/eden/models/000_config.py sed -i 's/#settings.base.prepopulate = 0/settings.base.prepopulate = 0/' /srv/sambro/applications/eden/models/000_config.py