mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-13 16:52:23 -05:00
Fixed some bash if blocks and removed env file from db.py
This commit is contained in:
11
db.py
11
db.py
@@ -4,20 +4,9 @@ from app import create_app, db
|
|||||||
from credstash import getAllSecrets
|
from credstash import getAllSecrets
|
||||||
import os
|
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()
|
|
||||||
|
|
||||||
# on aws get secrets and export to env
|
# on aws get secrets and export to env
|
||||||
os.environ.update(getAllSecrets(region="eu-west-1"))
|
os.environ.update(getAllSecrets(region="eu-west-1"))
|
||||||
|
|
||||||
from config import configs
|
|
||||||
|
|
||||||
os.environ['NOTIFY_API_ENVIRONMENT'] = configs[environment]
|
|
||||||
|
|
||||||
application = create_app()
|
application = create_app()
|
||||||
|
|
||||||
manager = Manager(application)
|
manager = Manager(application)
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ then
|
|||||||
echo "Chown application to be owned by notify-app"
|
echo "Chown application to be owned by notify-app"
|
||||||
cd /home/notify-app/;
|
cd /home/notify-app/;
|
||||||
chown -R notify-app:govuk-notify-applications notifications-api
|
chown -R notify-app:govuk-notify-applications notifications-api
|
||||||
fi
|
|
||||||
else
|
else
|
||||||
echo "Chown application to be owned by ubuntu"
|
echo "Chown application to be owned by ubuntu"
|
||||||
cd /home/ubuntu/;
|
cd /home/ubuntu/;
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ then
|
|||||||
cd /home/ubuntu/notifications-api;
|
cd /home/ubuntu/notifications-api;
|
||||||
pip3 install -r /home/notify-app/notifications-api/requirements.txt
|
pip3 install -r /home/notify-app/notifications-api/requirements.txt
|
||||||
python3 db.py db upgrade
|
python3 db.py db upgrade
|
||||||
fi
|
|
||||||
else
|
else
|
||||||
echo "Depenencies for ubuntu"
|
echo "Depenencies for ubuntu"
|
||||||
cd /home/ubuntu/notifications-api;
|
cd /home/ubuntu/notifications-api;
|
||||||
|
|||||||
Reference in New Issue
Block a user