Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- initialize() {
- echo "mayan: initialize()"
- su mayan -c "${MAYAN_BIN} initialsetup --force"
- su mayan -c "${MAYAN_BIN} collectstatic --noinput --clear"
- }
- upgrade() {
- echo "mayan: upgrade()"
- su mayan -c "${MAYAN_BIN} performupgrade"
- su mayan -c "${MAYAN_BIN} collectstatic --noinput --clear"
- }
- start() {
- echo "mayan: start()"
- rm -rf /var/run/supervisor.sock
- exec /usr/bin/supervisord -nc /etc/supervisor/supervisord.conf
- }
- os_package_installs() {
- echo "mayan: os_package_installs()"
- if [ "${MAYAN_APT_INSTALLS}" ]; then
- apt-get-install $MAYAN_APT_INSTALLS
- fi
- }
- pip_installs() {
- echo "mayan: pip_installs()"
- if [ "${MAYAN_PIP_INSTALLS}" ]; then
- $MAYAN_PIP_BIN install $MAYAN_PIP_INSTALLS
- fi
- }
- os_package_installs || true
- pip_installs || true
- case "$1" in
- mayan) # Check if this is a new install, otherwise try to upgrade the existing
- # installation on subsequent starts
- if [ ! -f $INSTALL_FLAG ]; then
- initialize
- else
- upgrade
- fi
- start
- ;;
- run-tests) # Check if this is a new install, otherwise try to upgrade the existing
- # installation on subsequent starts
- if [ ! -f $INSTALL_FLAG ]; then
- initialize
- else
- upgrade
- fi
- $DOCKER_ROOT/run-tests.sh
- ;;
- *) su mayan -c "$@";
- ;;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement