From: Mathias Klette Date: Tue, 4 Jun 2013 10:07:01 +0000 (+0200) Subject: debian_build: include try/except for rebase operations X-Git-Url: https://git.uhu-banane.de/?a=commitdiff_plain;h=0e1b6307c527f178902578ae643cd593533f14a4;p=profitbricks%2Fjenkins-build-scripts.git debian_build: include try/except for rebase operations --- diff --git a/debian_build.py b/debian_build.py index 86922b4..b54b498 100755 --- a/debian_build.py +++ b/debian_build.py @@ -330,18 +330,20 @@ if __name__ == '__main__': logger.info('Force building with tests as we also merge your branch.') ENV['BUILD_TRIGGERS'].remove('no-test') - src_branch = local_branch # save the original branch - dst_branch = 'integration' # define the new branch - local_branch = dst_branch # reset env for git-buildpackage - # FIXME: error handling when rebase doesn't cleanly complete? - gitrepo.git.rebase('origin/' + dst_branch) - gitrepo.git.checkout(dst_branch) - gitrepo.git.pull() - gitrepo.git.merge(src_branch) - logger.info('Rebase and merge from branch "{src_branch} completed. Now in "{dst_branch}".'.format( - dst_branch=dst_branch, - src_branch=src_branch, - )) + try: + src_branch = local_branch # save the original branch + dst_branch = 'integration' # define the new branch + local_branch = dst_branch # reset env for git-buildpackage + gitrepo.git.rebase('origin/' + dst_branch) + gitrepo.git.checkout(dst_branch) + gitrepo.git.pull() + gitrepo.git.merge(src_branch) + logger.info('Rebase and merge from branch "{src_branch} completed. Now in "{dst_branch}".'.format( + dst_branch=dst_branch, + src_branch=src_branch, + )) + except Exception as error: + logger.error('Rebase has failed!', exc_info=error) if 'no-test' in ENV['BUILD_TRIGGERS']: # debian/rules from vdc-bundles determines maven options for tests