From 0933c153ea928100a371420baa0d40ae651f1031 Mon Sep 17 00:00:00 2001 From: Martyn Inglis Date: Mon, 4 Jul 2016 16:17:07 +0100 Subject: [PATCH] Added notify-app if/else block so can run on new staging and preview --- scripts/aws_change_ownership.sh | 15 ++++++++++++--- scripts/aws_install_dependencies.sh | 18 +++++++++++++++--- 2 files changed, 27 insertions(+), 6 deletions(-) diff --git a/scripts/aws_change_ownership.sh b/scripts/aws_change_ownership.sh index 411d380b1..8b565625a 100755 --- a/scripts/aws_change_ownership.sh +++ b/scripts/aws_change_ownership.sh @@ -1,5 +1,14 @@ #!/bin/bash -echo "Chown application to be owned by ubuntu" -cd /home/ubuntu/; -chown -R ubuntu:ubuntu notifications-api + +if [ -e "/home/notify-app" ] +then + echo "Chown application to be owned by notify-app" + cd /home/notify-app/; + chown -R notify-app:govuk-notify-applications notifications-api +fi +else + echo "Chown application to be owned by ubuntu" + cd /home/ubuntu/; + chown -R ubuntu:ubuntu notifications-api +fi \ No newline at end of file diff --git a/scripts/aws_install_dependencies.sh b/scripts/aws_install_dependencies.sh index c080296ee..b02049c88 100755 --- a/scripts/aws_install_dependencies.sh +++ b/scripts/aws_install_dependencies.sh @@ -1,4 +1,16 @@ echo "Install dependencies" -cd /home/ubuntu/notifications-api; -pip3 install -r /home/ubuntu/notifications-api/requirements.txt -python3 db.py db upgrade + + +if [ -e "/home/notify-app" ] +then + echo "Depenencies for notify-app" + cd /home/ubuntu/notifications-api; + pip3 install -r /home/notify-app/notifications-api/requirements.txt + python3 db.py db upgrade +fi +else + echo "Depenencies for ubuntu" + cd /home/ubuntu/notifications-api; + pip3 install -r /home/ubuntu/notifications-api/requirements.txt + python3 db.py db upgrade +fi \ No newline at end of file