command/build: if any builds fail, exit with 1 exit status

This commit is contained in:
Mitchell Hashimoto 2013-07-23 13:36:07 -07:00
parent 2f0e831658
commit 2227e5ab31
2 changed files with 6 additions and 0 deletions

View File

@ -16,6 +16,7 @@ IMPROVEMENTS:
BUG FIXES: BUG FIXES:
* core: build names no longer cause invalid config errors. [GH-197] * 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] * communicator/ssh: SCP exit codes are tested and errors are reported. [GH-195]
## 0.2.0 (July 16, 2013) ## 0.2.0 (July 16, 2013)

View File

@ -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.") 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 return 0
} }