]> Frank Brehm's Git Trees - profitbricks/jenkins-build-scripts.git/commitdiff
fail after gathering reports if build has failed
authorTobias von der Krone <tobias.vonderkrone@profitbricks.com>
Mon, 14 Oct 2013 10:36:08 +0000 (12:36 +0200)
committerTobias von der Krone <tobias.vonderkrone@profitbricks.com>
Mon, 14 Oct 2013 10:36:08 +0000 (12:36 +0200)
debian_build.py

index 016191863ef67c9be20b81231dca0bb76c7a9dbc..3147810da2a21957d6f11d0873bbf00bb98af965 100755 (executable)
@@ -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(