gitlab-plugin
gitlab-plugin copied to clipboard
Ability to build tag without "triggerOnPush"
What feature do you want to see added?
Hi, in the use case where I want to build only tags and branches under MR, without building EACH branch pushed, I've setup the plugin in following way:
triggers {
gitlab(branchFilterType: 'All',
excludeBranchesSpec: '',
includeBranchesSpec: '',
cancelPendingBuildsOnUpdate: false,
ciSkip: true,
noteRegex: '([Jj]enkins).*(retry).*',
pendingBuildName: '',
secretToken: '[REDACTED]',
setBuildDescription: true,
skipWorkInProgressMergeRequest: true,
sourceBranchRegex: '',
targetBranchRegex: '',
addVoteOnMergeRequest: true,
triggerOnAcceptedMergeRequest: false,
triggerOnApprovedMergeRequest: false,
triggerOnClosedMergeRequest: false,
triggerOnMergeRequest: true,
triggerOnNoteRequest: true,
triggerOnlyIfNewCommitsPushed: true,
triggerOpenMergeRequestOnPush: 'source',
triggerOnPush: false,
triggerOnPipelineEvent: false,
triggerToBranchDeleteRequest: false)
}
with this configuration I can buid branches under MR but tags cannot be built.
The only way to trigger tag builds is changing triggerOnPush: false to true, but the drawback is that EVERY pushed branch will be built (and it's something not wanted).
Is it possible to have a checkmark to explicitly select "Tag Push Event"?
Thanks.
Upstream changes
No response
Are you interested in contributing this feature?
I've no idea on how to contribute.
Hello. I believe I'm a little bit late. Anyway, I believe there are several ways to solve this.
- Use Jenkins integration inside GitLab and click on
Tag pushonly if you don't want to build for any commit push without a tag. - If you use Multibranch Pipeline, you can install Basic Branch Build Strategies to make it build for filtered tags (by time) and/or filtered branches (by names).
- If you use a pure pipeline, you can use the argument
sourceBranchRegexof the GitLab trigger to filter therefof the GitLab webhook attribute to allow tags which start with "refs/tags/", like^ref/tags/.*$, and/or other specific branches if you want. Just treat tags like branches.