I have AWS with two instances. I configured CodeDeploy to automatically deploy my project in all instances.
In appspec.ymlI have this section:
hooks:
AfterInstall:
- location: codedeploy_scripts/deploy_afterinstall
timeout: 300
runas: root
deploy_afterinstallis a simple bash script. Sometimes some of the teams in it fail. For example, this command that updates / installs the composer's dependencies.
if [ -f "composer.lock" ]; then
composer update -n
else
composer install -n
fi
But CodeDeploy ignores any errors in this script and always says that the deployment was successful. How can I change this behavior? I want the deployment to fail when some of the commands in the hook were not completed successfully and to see errors in the deployment console or log.