]> Frank Brehm's Git Trees - profitbricks/jenkins-build-scripts.git/commitdiff
gentoo_build: Print a nice error message if pushing a tag fails.
authorBenjamin Drung <benjamin.drung@profitbricks.com>
Wed, 22 Jan 2014 12:33:47 +0000 (13:33 +0100)
committerBenjamin Drung <benjamin.drung@profitbricks.com>
Wed, 22 Jan 2014 12:33:47 +0000 (13:33 +0100)
gentoo_build

index 48098830977d6bd39ef8a10476a6dd39ea6b27a9..4de5d5ac1a4b49b9bfa020d76808c20898dd9116 100755 (executable)
@@ -408,7 +408,11 @@ def push_tag(logger, repo, tag, dry_run):
                     "requested.".format(tag=tag))
     else:
         logger.info("Pushing tag {tag}...".format(tag=tag))
-        repo.git.push("origin", tag)
+        try:
+            repo.git.push("origin", tag)
+        except git.GitCommandError as error:
+            logger.error('Could not push tag: ' + str(error))
+            sys.exit(1)
 
 if __name__ == '__main__':
     main()