From 6422fabd192bebfd035d6e2ded4d1a7bc654a2d2 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Tue, 23 Jul 2013 13:36:07 -0700 Subject: [PATCH] command/build: if any builds fail, exit with 1 exit status --- CHANGELOG.md | 1 + command/build/command.go | 5 +++++ 2 files changed, 6 insertions(+) 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 }