diff --git a/app/__init__.py b/app/__init__.py index fc5c73b8e..926fd5f13 100644 --- a/app/__init__.py +++ b/app/__init__.py @@ -24,6 +24,8 @@ def create_app(config_name): application.config['NOTIFY_API_ENVIRONMENT'] = config_name application.config.from_object(configs[config_name]) + if config_name is not 'development': + application.config.from_envvar('FLASK_CONFIG') db.init_app(application) init_app(application) init_csrf(application) diff --git a/appspec.yml b/appspec.yml index 0ea8d981b..ba8828d98 100644 --- a/appspec.yml +++ b/appspec.yml @@ -9,6 +9,10 @@ hooks: timeout: 300 runas: root ApplicationStart: - - location: scripts/aws_run_app.sh + - location: scripts/aws_start_app.sh timeout: 300 - runas: root + runas: ubuntu + ApplicationStop: + - location: scripts/aws_stop_app.sh + timeout: 300 + runas: ubuntu diff --git a/scripts/aws_run_app.sh b/scripts/aws_run_app.sh deleted file mode 100755 index bd260bc79..000000000 --- a/scripts/aws_run_app.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -echo "Starting application" -python /home/ubuntu/notifications-admin/app.py runserver & diff --git a/scripts/aws_start_app.sh b/scripts/aws_start_app.sh index 1c3743f2c..3ba8676dd 100755 --- a/scripts/aws_start_app.sh +++ b/scripts/aws_start_app.sh @@ -1,5 +1,6 @@ #!/bin/bash echo "Starting application" +export NOTIFICATIONS_ADMIN_ENVIRONMENT='live' cd ~/notifications-admin/; sudo service notifications-admin start \ No newline at end of file