diff --git a/appspec.yml b/appspec.yml new file mode 100644 index 000000000..cefddcb1d --- /dev/null +++ b/appspec.yml @@ -0,0 +1,23 @@ +--- +files: + - + destination: /home/ubuntu/notifications-api + source: / +hooks: + AfterInstall: + - + location: scripts/aws_install_dependencies.sh + runas: root + timeout: 300 + ApplicationStart: + - + location: scripts/aws_start_app.sh + runas: root + timeout: 300 + ApplicationStop: + - + location: scripts/aws_stop_app.sh + runas: root + timeout: 300 +os: linux +version: 0.0 diff --git a/scripts/aws_install_dependencies.sh b/scripts/aws_install_dependencies.sh new file mode 100644 index 000000000..6d7d76a6f --- /dev/null +++ b/scripts/aws_install_dependencies.sh @@ -0,0 +1 @@ +pip install -r /home/ubuntu/notifications-api/requirements.txt diff --git a/scripts/aws_start_app.sh b/scripts/aws_start_app.sh new file mode 100644 index 000000000..55edf55b9 --- /dev/null +++ b/scripts/aws_start_app.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +echo "Starting application" +cd ~/notifications-api/; +sudo service notifications-api start \ No newline at end of file diff --git a/scripts/aws_stop_app.sh b/scripts/aws_stop_app.sh new file mode 100644 index 000000000..9dc15fbd8 --- /dev/null +++ b/scripts/aws_stop_app.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +echo "Stopping application" +cd ~/notifications-api/; +sudo service notifications-api stop \ No newline at end of file