gitlab-branch-source-plugin
gitlab-branch-source-plugin copied to clipboard
Trigger job when an MR is closed
Hello Team,
Thanks for your good work ! Is it possible to trigger a job when an MR is closed ? I have enabled the Merge request events hooks on gitlab side but I can't trigger the job associated when the MR is closed.
Do I have a specific configuration to do ?
I think the Job gets triggered (visible in logs), but it is a noop, since jenkins has already built the same version of the branch (only an assumption).
See https://github.com/jenkinsci/gitlab-plugin/pull/1001 in gitlab-plugin for reference. Could this be the same case for gitlab-branch-source-plugin?
You're right, the job is triggered:
[Tue Feb 16 13:52:31 UTC 2021] Received Merge request !4 closed in project $PROJECT REMOVED event from $IP ⇒ https://$JENKINS_URL/gitlab-webhook/post with timestamp Tue Feb 16 13:52:31 UTC 2021
I agree with you, we need the same behaviour than gitlab-plugin and allow to force rebuild when the option is checked.
Similarly, I'd like to trigger the pipeline when MR is approved. right now if i push an update to a branch and the pipeline fails, if i approve the merge request, the pipeline is not triggered again.