2016-05-11 15:52:49 +01:00
|
|
|
from flask_migrate import Migrate, MigrateCommand
|
|
|
|
|
from app import (create_app, db, commands)
|
|
|
|
|
import os
|
|
|
|
|
|
|
|
|
|
default_env_file = '/home/ubuntu/environment'
|
|
|
|
|
environment = 'live'
|
|
|
|
|
|
|
|
|
|
if os.path.isfile(default_env_file):
|
|
|
|
|
with open(default_env_file, 'r') as environment_file:
|
|
|
|
|
environment = environment_file.readline().strip()
|
|
|
|
|
|
2016-12-08 12:12:45 +00:00
|
|
|
from app.config import configs
|
2016-05-11 15:52:49 +01:00
|
|
|
|
|
|
|
|
os.environ['NOTIFY_API_ENVIRONMENT'] = configs[environment]
|
|
|
|
|
|
|
|
|
|
application = create_app()
|
|
|
|
|
|
|
|
|
|
migrate = Migrate(application, db)
|
2017-11-06 12:34:29 +00:00
|
|
|
application.add_command('db', MigrateCommand)
|
|
|
|
|
application.add_command('purge_functional_test_data', commands.PurgeFunctionalTestDataCommand)
|
|
|
|
|
application.add_command('custom_db_script', commands.CustomDbScript)
|
2016-05-11 15:52:49 +01:00
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
|
manager.run()
|