debian_build: when rebase failed use some more actions to recover
-------- Original-Nachricht --------
Betreff: Jenkins Build dev_vdc-bundle - failed rebase not cleaned up correctly
Datum: Fri, 14 Jun 2013 20:33:44 +0200
Von: Ramona Koch <ramona.koch@profitbricks.com>
Antwort an: ramona.koch@profitbricks.com
An: dcops <dcops@profitbricks.com>, Core <core@profitbricks.com>, Mehrdad Arifi <mehrdad.arifi@profitbricks.com>
Hi DC Ops, Hi Core, Hi Mehrdad
I just noticed, that the 'workspace' is not correctly cleaned up, if the rebase had failed.
All builds trying to merge afterwards will also fail during rebase with:
It seems that I cannot create a rebase-apply directory, and I wonder if you are in the middle of patch application or another
rebase. If that is not the case, please
rm -fr /var/lib/jenkins/jobs/dev_vdc-bundles/workspace/.git/rebase-apply
and run me again. I am stopping in case you still have something valuable there.
@DCOps:
I checked your debian_build.py at:
337 try:
338 src_branch = local_branch # save the original branch
339 dst_branch = 'integration' # define the new branch
340 local_branch = dst_branch # reset env for
git-buildpackage
341 gitrepo.git.rebase('origin/' + dst_branch)
342 gitrepo.git.checkout(dst_branch)
343 gitrepo.git.pull()
344 gitrepo.git.merge(src_branch)
345 logger.info('Rebase and merge from branch "{src_branch}"
completed. Now in "{dst_branch}".'.format(
346 dst_branch=dst_branch,
347 src_branch=src_branch,
348 ))
349 except Exception as error:
350 logger.error('Rebase has failed!', exc_info=error)
351 gitrepo.git.reset('--hard',src_branch)
352 exit_error()
and I assume that 'git reset --hard' is not enough. Probably a 'git rebase --abort' needs to be done before. If this does not work - simply removing the mentioned file will work.
Could you check, if my assumption is correct and fix it, please.