From: Holger Levsen Date: Wed, 14 Mar 2012 12:42:43 +0000 (+0100) Subject: add error handling X-Git-Url: https://git.uhu-banane.net/?a=commitdiff_plain;h=8e80a5019bafe24a691fe9df036599ad51a3ab08;p=profitbricks%2Fjenkins-build-scripts.git add error handling --- diff --git a/debian_build.py b/debian_build.py index 69e38b2..4a23adf 100755 --- a/debian_build.py +++ b/debian_build.py @@ -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()