mirror of
https://github.com/sartography/protocol-builder-mock.git
synced 2025-01-12 08:44:46 +00:00
Merge branch 'dev' into rrt/dev
This commit is contained in:
commit
1e826bbd21
@ -22,7 +22,6 @@ COPY . /protocol-builder-mock/
|
||||
ENV FLASK_APP=/protocol-builder-mock/app.py
|
||||
|
||||
# run webserver by default
|
||||
CMD ["pipenv", "run", "flask", "db", "upgrade"]
|
||||
CMD ["pipenv", "run", "python", "/protocol-builder-mock/run.py"]
|
||||
|
||||
# expose ports
|
||||
|
2
app.py
2
app.py
@ -107,7 +107,7 @@ def index():
|
||||
# display results
|
||||
studies = db.session.query(Study).order_by(Study.DATE_MODIFIED.desc()).all()
|
||||
table = StudyTable(studies)
|
||||
return render_template('index.html', table=table)
|
||||
return render_template('index.html', table=table, BASE_HREF=app.config['BASE_HREF'])
|
||||
|
||||
|
||||
@app.route('/new_study', methods=['GET', 'POST'])
|
||||
|
@ -8,6 +8,7 @@ FLASK_PORT = environ.get('PORT0') or environ.get('FLASK_PORT', default="5001")
|
||||
CORS_ENABLED = False
|
||||
DEVELOPMENT = environ.get('DEVELOPMENT', default="true") == "true"
|
||||
TESTING = environ.get('TESTING', default="false") == "true"
|
||||
BASE_HREF = environ.get('BASE_HREF', default="/")
|
||||
|
||||
DB_HOST = environ.get('DB_HOST', default="localhost")
|
||||
DB_PORT = environ.get('DB_PORT', default="5432")
|
||||
|
@ -2,5 +2,20 @@
|
||||
|
||||
# run migrations
|
||||
export FLASK_APP=./app.py
|
||||
pipenv run flask db upgrade
|
||||
|
||||
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
|
||||
|
||||
pipenv run python ./run.py
|
||||
|
@ -2,6 +2,7 @@
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>Protocol Builder Mock</title>
|
||||
<base href="{{ BASE_HREF }}">
|
||||
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
|
||||
<link rel="stylesheet" href="https://use.typekit.net/kwp6dli.css">
|
||||
{% assets 'app_scss' %}
|
||||
|
Loading…
x
Reference in New Issue
Block a user