mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2024-12-26 03:14:19 +00:00
Simplify the deployment process. You don't need to use 'flask db upgrade' or 'flask insert-initial-database-entries' anymore. Instead you just need to use 'flask deploy'.
This commit is contained in:
parent
188aeae88f
commit
f91583484e
17
nopaque.py
17
nopaque.py
@ -2,7 +2,7 @@ import eventlet
|
|||||||
eventlet.monkey_patch() # noqa
|
eventlet.monkey_patch() # noqa
|
||||||
from app import create_app, db, socketio
|
from app import create_app, db, socketio
|
||||||
from app.models import Corpus, Job, Role, User
|
from app.models import Corpus, Job, Role, User
|
||||||
from flask_migrate import Migrate
|
from flask_migrate import Migrate, upgrade
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
|
||||||
@ -18,6 +18,16 @@ def make_shell_context():
|
|||||||
'User': User}
|
'User': User}
|
||||||
|
|
||||||
|
|
||||||
|
@app.cli.command()
|
||||||
|
def deploy():
|
||||||
|
"""Run deployment tasks."""
|
||||||
|
# migrate database to latest revision
|
||||||
|
upgrade()
|
||||||
|
|
||||||
|
# create or update user roles
|
||||||
|
Role.insert_roles()
|
||||||
|
|
||||||
|
|
||||||
@app.cli.command()
|
@app.cli.command()
|
||||||
def test():
|
def test():
|
||||||
"""Run the unit tests."""
|
"""Run the unit tests."""
|
||||||
@ -26,10 +36,5 @@ def test():
|
|||||||
unittest.TextTestRunner(verbosity=2).run(tests)
|
unittest.TextTestRunner(verbosity=2).run(tests)
|
||||||
|
|
||||||
|
|
||||||
@app.cli.command('insert-initial-database-entries')
|
|
||||||
def insert_initial_database_entries():
|
|
||||||
Role.insert_roles()
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
socketio.run(app, host='0.0.0.0')
|
socketio.run(app, host='0.0.0.0')
|
||||||
|
Loading…
Reference in New Issue
Block a user