I have a Node.js application which is being automatically deployed to Amazon Web Service through Codeship using the CodeDeploy AWS
The ApplicationStop
hook is being called from the previously installed deployment before trying to run the current deployment appspec.yml
file.
In order to prevent this from happening you'll have to remove any previously installed deployment from the server.
sudo service codedeploy-agent stop
/opt/codedeploy-agent/deployment-root
sudo service codedeploy-agent start
There is another way documented in the AWS developer forums, which I think is preferable.
Use the --ignore-application-stop-failures option with the CLI tool while doing the deployment, it worked perfectly for me.
Example taken from the forum:
aws deploy create-deployment --application-name APPLICATION --deployment-group-name GROUP --ignore-application-stop-failures --s3-location bundleType=tar,bucket=BUCKET,key=KEY --description "Ignore ApplicationStop failures due to broken script"
https://forums.aws.amazon.com/thread.jspa?threadID=166904