can you print the exit code as soon as packer finish? in bash is echo $?
in cmd i think is echo %exitcode% or someting >From what I have seen i think in powershell you need to evaluate the exit code and make a break/exit if you want that due a non-zero exit code. Alvaro On Fri, Sep 29, 2017 at 3:00 PM, Dave Randall <[email protected]> wrote: > I'm running packer on a Windows Server box and invoking it with > PowerShell. I want the script itself to throw an error if the packer build > fails. However, when I get *packer build* to fail on purpose (e.g. by > supplying incorrect AWS access keys) it still returns a 0 exit code as if > it completed successfully. > > Is there any way to get packer to return a non-zero exit code on failure? > > I've reviewed the documentation but to no avail. The closest thing was to > add a -on-error=abort option, but that didn't make an impact. > > Cheers, > > Dave > > -- > 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/mitchellh/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/df8169aa-c99c-445c-b69e-ef1c07a919ed%40googlegroups.com > <https://groups.google.com/d/msgid/packer-tool/df8169aa-c99c-445c-b69e-ef1c07a919ed%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- Alvaro -- 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/mitchellh/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/CAHqq0exw5sHcGxA8itVTYvvt8hfB-O2a2WVg5uAACgE_HAfxFQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
