2020-02-07 02:08:49 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2020-02-05 22:07:34 +00:00
|
|
|
# run migrations
|
2020-05-25 04:47:49 +00:00
|
|
|
export FLASK_APP=/app/crc/__init__.py
|
2020-04-15 18:43:09 +00:00
|
|
|
|
2020-04-21 23:37:56 +00:00
|
|
|
if [ "$DOWNGRADE_DB" = "true" ]; then
|
2020-05-22 18:55:55 +00:00
|
|
|
echo 'Downgrading database...'
|
2020-04-21 23:37:56 +00:00
|
|
|
pipenv run flask db downgrade
|
|
|
|
fi
|
|
|
|
|
2020-05-22 18:55:55 +00:00
|
|
|
if [ "$UPGRADE_DB" = "true" ]; then
|
|
|
|
echo 'Upgrading database...'
|
|
|
|
pipenv run flask db upgrade
|
|
|
|
fi
|
2020-02-07 02:08:49 +00:00
|
|
|
|
|
|
|
if [ "$RESET_DB" = "true" ]; then
|
|
|
|
echo 'Resetting database...'
|
|
|
|
pipenv run flask load-example-data
|
|
|
|
fi
|
|
|
|
|
2020-05-25 15:41:53 +00:00
|
|
|
if [ "$APPLICATION_ROOT" = "/" ]; then
|
2020-05-25 16:26:17 +00:00
|
|
|
pipenv run gunicorn --bind 0.0.0.0:$PORT0 wsgi:app
|
2020-05-25 15:41:53 +00:00
|
|
|
else
|
|
|
|
pipenv run gunicorn -e SCRIPT_NAME="$APPLICATION_ROOT" --bind 0.0.0.0:$PORT0 wsgi:app
|
|
|
|
fi
|