My goal is to trigger a multibranch pipeline in jenkins when a tag is created in gitlab.
This is my trigger config in jenkinsfile :
triggers {
gitlab(
triggerOnPush: true, // Disable trigger on regular branch pushes
triggerOnMergeRequest: true, // Disable trigger on merge requests
triggerOpenMergeRequestOnPush: "both", // Disable trigger on open merge requests<
//triggerOnTagPush: true, // Enable trigger on tag pushes
branchFilterType: 'All', // Trigger on all branches (optional, adjust as needed)
cancelPendingBuildsOnUpdate: true, // Cancel pending builds if new push/tag is detected
triggerOnAcceptedMergeRequest: true,
triggerOnApprovedMergeRequest: true
)
}
And the config in the refspec’s project :
ofc, I configured the webhook correclty on the gitlab’s end and I activated the push and merge request events.
My Pipeline is launched upon these triggers :
- on push
- merge request accepted
My Pipeline is NOT launched upon these triggers :
- on tag push
- on merge request approved
- on merge request created (I know that this is only available in gitlab’s entreprise edition)
And in jenkins’s log, I’m seing the tag event is getting received :
Push: {
"object_kind" : "***tag_push***",
"event_name" : "***tag_push***",
"before" : "0000000000000000000000000000000000000000",
"after" : "a6faedc42b129681e36ead05a3c7c07a3d59d335",
"ref" : "refs/tags/v3.0",
"ref_protected" : false,
....
}
Am I missing something ?
Thank you.