Merge pull request #825 from alphagov/fix-clear-instance-before-deploy

Remove app and py3 packages on codedeploy-ment
This commit is contained in:
imdadahad
2017-02-15 10:54:39 +00:00
committed by GitHub
2 changed files with 14 additions and 0 deletions

View File

@@ -5,6 +5,10 @@ files:
- destination: /home/notify-app/notifications-api
source: /
hooks:
BeforeInstall:
- location: scripts/aws_clear_instance.sh
runas: root
timeout: 1000
AfterInstall:
- location: scripts/aws_install_dependencies.sh
runas: root

10
scripts/aws_clear_instance.sh Executable file
View File

@@ -0,0 +1,10 @@
#!/bin/bash
echo "Removing application and dependencies"
if [ -d "/home/notify-app/notifications-api" ]; then
# Remove and re-create the directory
rm -rf /home/notify-app/notifications-api
mkdir -p /home/notify-app/notifications-api
fi