-
Notifications
You must be signed in to change notification settings - Fork 1
/
manage.py
37 lines (26 loc) · 1012 Bytes
/
manage.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
"""
This is the manager entrypoint to the application
"""
import os
from flask_script import Manager
from flask_migrate import MigrateCommand
from src.app import create_app
from src.cli.run import RunCommand
from src.cli.test import RunTestsCommand, RunTestsXMLCommand
from src.cli.celery import StartCeleryWorkersCommand
from src.cli.config import GenerateSecretsCommand, InitConfigCommand
MANAGER = Manager(create_app(os.getenv('FLASK_CONFIG') or 'dev'))
# Run the application
MANAGER.add_command('run', RunCommand())
# Perform database operations
MANAGER.add_command('db', MigrateCommand)
# Manage the 'synbrowser.config' file
MANAGER.add_command('create_secrets', GenerateSecretsCommand)
MANAGER.add_command('init_config', InitConfigCommand)
# Start and stop celery workers
MANAGER.add_command('start_workers', StartCeleryWorkersCommand())
# Run test
MANAGER.add_command('test', RunTestsCommand())
MANAGER.add_command('test_xml', RunTestsXMLCommand())
if __name__ == '__main__':
MANAGER.run()