From: Tobias von der Krone Date: Mon, 14 Oct 2013 10:36:08 +0000 (+0200) Subject: fail after gathering reports if build has failed X-Git-Url: https://git.uhu-banane.net/?a=commitdiff_plain;h=bb544833b5cc7142c9a5b930b00990168df48b03;p=profitbricks%2Fjenkins-build-scripts.git fail after gathering reports if build has failed --- diff --git a/debian_build.py b/debian_build.py index 0161918..3147810 100755 --- a/debian_build.py +++ b/debian_build.py @@ -520,6 +520,7 @@ export {gbp_env} FORCE_SHELL=TRUE # .. and finally handle the result if ret: + build_failed = False logger.error('git-buildpackage failed with exitcode {code}'.format(code=ret)) figlet('Build failed') failed_message = 'package build has failed' @@ -530,6 +531,7 @@ export {gbp_env} FORCE_SHELL=TRUE do_uploads = False no_uploads_cause = failed_message else: + build_failed = True figlet('Build OK') # @@ -563,6 +565,10 @@ export {gbp_env} FORCE_SHELL=TRUE except: pass + # now fail if build failed + if build_failed: + exit_error() + # .. let's tag if not do_tagging: figlet('Tagging skipped - {cause}'.format(