22 lines
798 B
Bash
Executable File
22 lines
798 B
Bash
Executable File
#!/bin/sh
|
|
set -ev
|
|
|
|
# Volumes
|
|
SAHANA_CONF="${VOLUMES_DIR}/sahana/sahana_conf"
|
|
SAHANA_DATA="${VOLUMES_DIR}/sahana/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 sahana-postgres
|
|
spoc-container exec -u sahana sahana -- sh -c 'cd /srv/web2py; ./web2py.py -S eden -M -R applications/eden/static/scripts/tools/noop.py'
|
|
spoc-container stop sahana-postgres
|
|
|
|
# Disable database migrations
|
|
sed -i 's/settings.base.migrate = True/settings.base.migrate = False/' ${SAHANA_CONF}/000_config.py
|