You say the script "fails to exit with an error code not equal to 0". So it is failing, and you have `set -e` but you aren't seeing Packer detect that it failed?
Try `set -euo pipefail` instead of just `set -e`. http://redsymbol.net/articles/unofficial-bash-strict-mode/ On Friday, June 19, 2020 at 3:18:40 AM UTC-5, Giorgio Cerruti wrote: > > Hi there, > I'm new to packer and I facing this issue. Basically, my workflow is to > upload a bash script within the EC2 made by packer to install the stack I > need to run my application. Now, sometimes something happens and the script > fails to exit with an error code not equal 0, but packer still creating the > AMI. How can I modify this behavior letting packer stops to build the AMI? > I need this because of my CI/CD pipeline. Moreover, I added the `set -e` > into my bash script. > > Thanks in advance. > > > -- This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list. GitHub Issues: https://github.com/hashicorp/packer/issues IRC: #packer-tool on Freenode --- You received this message because you are subscribed to the Google Groups "Packer" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/660b6bc0-9d7c-4b31-b0ca-0639a92d95fco%40googlegroups.com.
