2020-02-17 16:47:34 -05:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# run migrations
|
2020-05-25 00:47:59 -04:00
|
|
|
export FLASK_APP=/app/pb/__init__.py
|
2020-05-22 14:56:46 -04:00
|
|
|
|
|
|
|
if [ "$DOWNGRADE_DB" = "true" ]; then
|
|
|
|
echo 'Downgrading database...'
|
|
|
|
pipenv run flask db downgrade
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "$UPGRADE_DB" = "true" ]; then
|
|
|
|
echo 'Upgrading database...'
|
|
|
|
pipenv run flask db upgrade
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "$RESET_DB" = "true" ]; then
|
|
|
|
echo 'Resetting database...'
|
|
|
|
pipenv run flask load-example-data
|
|
|
|
fi
|
|
|
|
|
2020-05-25 11:41:39 -04:00
|
|
|
if [ "$APPLICATION_ROOT" = "/" ]; then
|
|
|
|
pipenv run gunicorn -e --bind 0.0.0.0:$PORT0 wsgi:app
|
|
|
|
else
|
|
|
|
pipenv run gunicorn -e SCRIPT_NAME="$APPLICATION_ROOT" --bind 0.0.0.0:$PORT0 wsgi:app
|
|
|
|
fi
|