diff --git a/CHANGELOG.md b/CHANGELOG.md index 0315cf16b..b8dd8da1a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ IMPROVEMENTS: BUG FIXES: * core: build names no longer cause invalid config errors. [GH-197] +* command/build: If any builds fail, exit with non-zero exit status. * communicator/ssh: SCP exit codes are tested and errors are reported. [GH-195] ## 0.2.0 (July 16, 2013) diff --git a/command/build/command.go b/command/build/command.go index 39eb590c1..2e813ea97 100644 --- a/command/build/command.go +++ b/command/build/command.go @@ -250,6 +250,11 @@ func (c Command) Run(env packer.Environment, args []string) int { env.Ui().Say("\n==> Builds finished but no artifacts were created.") } + if len(errors) > 0 { + // If any errors occurred, exit with a non-zero exit status + return 1 + } + return 0 }