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