Spotter-VM/lxc-apps/sambro/update.sh

22 lines
798 B
Bash
Raw Permalink Normal View History

#!/bin/sh
set -ev
# Volumes
SAHANA_CONF="${VOLUMES_DIR}/sambro/sahana_conf"
SAHANA_DATA="${VOLUMES_DIR}/sambro/sahana_data"
# Add new persistent volumes - added in 1.0.3-200504
install -o 108080 -g 108080 -m 750 -d ${SAHANA_DATA}/errors
install -o 108080 -g 108080 -m 750 -d ${SAHANA_DATA}/sessions
# Enable database migrations
sed -i 's/settings.base.migrate = False/settings.base.migrate = True/' ${SAHANA_CONF}/000_config.py
# Run database migration
spoc-container start sambro-postgres
spoc-container exec -u sahana sambro -- sh -c 'cd /srv/web2py; ./web2py.py -S eden -M -R applications/eden/static/scripts/tools/noop.py'
spoc-container stop sambro-postgres
# Disable database migrations
sed -i 's/settings.base.migrate = True/settings.base.migrate = False/' ${SAHANA_CONF}/000_config.py