Mark Waite commented on Bug JENKINS-22319

I think I'm beginning to understand. I assume you're using the pre-scm-buildstep plugin to determine the branch to build, to create that branch, and to checkout that branch.

Does your job fail at least once if you wipe the workspace? I assume the initial workspace creation doesn't happen until after the pre-scm-buildstep, but your pre-scm-buildstep requires that the workspace exists in order to perform the checkout.

I've been able to replicate enough of your scenario to see that it fails for me as well. I created a pre-scm-buildstep shell script which performs the following commands:

git checkout master || git checkout -b master -t origin/master
git branch -D jenkins
git checkout -b jenkins a449a3e5a101623cdd70d9eecdbe0ca0335a86b3

That allows the build to proceed, but it still fails if the Branches to build is "refs/heads/jenkins".

With enough shell script work, I suspect something like that can be made to work even in the case where the workspace has been wiped prior to the start of the job.

Unfortunately, I consider this a very special case that probably won't get a lot of attention in the plugins (git-plugin and git-client-plugin) unless you're willing to invest time to help with it.

You might consider evaluating the current tip of the git-plugin branch on GitHub, since it includes an unreleased change that affects this area. If it works for your case, then this bug will be fixed with the next release of the git-plugin. If that does not fix this case, then you could consider that change as a base and attempt to submit a pull request which will cover your case as well.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira

--
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to