cr-connect-workflow/docker_run.sh

39 lines
903 B
Bash
Raw Normal View History

#!/bin/bash
# run migrations
2020-05-25 04:47:49 +00:00
export FLASK_APP=/app/crc/__init__.py
2020-04-21 23:37:56 +00:00
if [ "$DOWNGRADE_DB" = "true" ]; then
echo 'Downgrading database...'
2020-04-21 23:37:56 +00:00
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
2020-05-27 16:58:50 +00:00
echo 'Resetting database and seeding it with example CR Connect data...'
pipenv run flask load-example-data
fi
2020-05-27 16:58:50 +00:00
if [ "$RESET_DB_RRT" = "true" ]; then
echo 'Resetting database and seeding it with example RRT data...'
pipenv run flask load-example-rrt-data
fi
if [ "$FIX_RRT_DATA" = "true" ]; then
echo 'Fixing RRT data...'
pipenv run flask rrt-data-fix
fi
# THIS MUST BE THE LAST COMMAND!
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
2020-06-19 12:44:02 +00:00