]> Frank Brehm's Git Trees - profitbricks/jenkins-build-scripts.git/commitdiff
add error handling
authorHolger Levsen <holger@layer-acht.org>
Wed, 14 Mar 2012 12:42:43 +0000 (13:42 +0100)
committerHolger Levsen <holger@layer-acht.org>
Wed, 14 Mar 2012 12:42:43 +0000 (13:42 +0100)
debian_build.py

index 69e38b22561d41251a2787820aa207ec5a930a4e..4a23adffd18dbdbf6a519688ff62c45f3d1b25c4 100755 (executable)
@@ -466,10 +466,18 @@ if __name__ == '__main__':
         # build was succesful, now let's tag it
         if GIT_BRANCH_NAME == 'master' or GIT_BRANCH_NAME.startswith('hotfix/'):
             cmd = ['/usr/bin/git', 'tag', version]
-            subprocess.check_call(cmd)
+            try:
+                subprocess.check_call(cmd)
+            except:
+                logger_error('Could not tag repository.')
+                exit_error()
             cmd = ['/usr/bin/git', 'push', 'origin', version]
-            subprocess.check_call(cmd)
-            # FIXME: intercept failures 
+            try:
+                subprocess.check_call(cmd)
+            except:
+                logger_error('Could not push tag.')
+                exit_error()
 
+        # finally
         exit_ok()