2016-01-11 09:59:31 +00:00
|
|
|
from credstash import getAllSecrets
|
2016-02-09 13:53:04 +00:00
|
|
|
import os
|
|
|
|
|
|
|
|
|
|
default_env_file = '/home/ubuntu/environment'
|
2016-03-17 13:45:59 +00:00
|
|
|
environment = 'live'
|
2016-02-09 13:53:04 +00:00
|
|
|
|
|
|
|
|
if os.path.isfile(default_env_file):
|
2016-03-17 13:45:59 +00:00
|
|
|
with open(default_env_file, 'r') as environment_file:
|
|
|
|
|
environment = environment_file.readline().strip()
|
2015-12-03 09:38:02 +00:00
|
|
|
|
2016-01-11 09:59:31 +00:00
|
|
|
|
2016-03-17 13:45:59 +00:00
|
|
|
# on aws get secrets and export to env
|
|
|
|
|
os.environ.update(getAllSecrets(region="eu-west-1"))
|
|
|
|
|
|
|
|
|
|
from config import configs
|
|
|
|
|
|
|
|
|
|
os.environ['NOTIFY_ADMIN_ENVIRONMENT'] = configs[environment]
|
|
|
|
|
|
2016-03-17 16:48:12 +00:00
|
|
|
from app import create_app
|
|
|
|
|
|
2016-03-17 13:45:59 +00:00
|
|
|
application = create_app()
|
2016-01-10 21:53:41 +00:00
|
|
|
|
2015-12-03 09:38:02 +00:00
|
|
|
if __name__ == "__main__":
|
2015-12-03 09:40:28 +00:00
|
|
|
application.run()
|