]> Frank Brehm's Git Trees - profitbricks/jenkins-build-scripts.git/commitdiff
debian_build: include try/except for rebase operations
authorMathias Klette <mathias.klette@profitbricks.com>
Tue, 4 Jun 2013 10:07:01 +0000 (12:07 +0200)
committerMathias Klette <mathias.klette@profitbricks.com>
Tue, 4 Jun 2013 10:07:01 +0000 (12:07 +0200)
debian_build.py

index 86922b4e70950a97da9323812c53f54b09391f79..b54b4987568296d9cc9ac59bfcbe99b20a4e0236 100755 (executable)
@@ -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