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
|
|
|
|
|
2020-08-14 09:39:05 -04:00
|
|
|
if [ "$RESET_DB" = "true" ]; then
|
|
|
|
echo 'Clearing database and loading example data...'
|
|
|
|
pipenv run flask load-example-data
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "$LOAD_EXAMPLE_SPONSORS" = "true" ]; then
|
|
|
|
echo 'Loading example data...'
|
|
|
|
pipenv run flask load-example-sponsors
|
|
|
|
fi
|
|
|
|
|
2020-05-25 11:41:39 -04:00
|
|
|
if [ "$APPLICATION_ROOT" = "/" ]; then
|
2020-05-25 12:26:07 -04:00
|
|
|
pipenv run gunicorn --bind 0.0.0.0:$PORT0 wsgi:app
|
2020-05-25 11:41:39 -04:00
|
|
|
else
|
|
|
|
pipenv run gunicorn -e SCRIPT_NAME="$APPLICATION_ROOT" --bind 0.0.0.0:$PORT0 wsgi:app
|
|
|
|
fi
|