-
Notifications
You must be signed in to change notification settings - Fork 619
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Trigger build or rebuild of non-head commit #241
Comments
Any manual build that you trigger is going to use only the Git plugin to check out code. The gitlab plugin will not be a factor at all. If you're talking about manual builds here, this is not a bug in our plugin. |
This is incorrect. At least, the manual for the Gitlab plugin affects checkout. Here is how.
Obviously, checkout fails. Currently I've fixed the problem by simply removing Conclusion. |
The parameter "gitlabSourceBranch" expects a branch name. You are passing it a SHA1 ID instead. That's why it is not working. This is not a bug in either plugin. If you want this to work, you would need to create an additional parameter for your job, called SHA1 or something, and have some logic within the job to have git check out origin/${gitlabSourceBranch} if that is populated, or check out SHA1 if that field is populated. And of course you will also need to catch the case where someone populates both fields :) |
Could you suggest me how I can add this logic? |
@wl2776 it would have to be something like a Workflow/Pipeline style build. https://github.com/jenkinsci/workflow-plugin That would let you wrap some logic around the checkout step, which is otherwise impossible in other build types. |
@omehegan Thanks, I will keep it in mind that my current fix with removing |
When the build is scheduled, add an extension that will go back and cancel queued builds, and abort running builds. Fixes jenkinsci#272 and fixes jenkinsci#241
Sometimes our builds fail because of the Jenkins bug (https://issues.jenkins-ci.org/browse/JENKINS-9104). Jenkins offers "Rebuild" button, but if some more commits were pushed to that branch, this button triggers rebuilding them (head of the branch instead of specific SHA1 ID).
Same situation appears if we want to manually rebuild some specific repository snapshot, which is not on the head of any branch.
The text was updated successfully, but these errors were encountered: