☰
Current Page
Main Menu
Home
Home
Editing
JenkinsMultibranchPipelineWithGitTagDiscovery
Edit
Preview
h1
h2
h3
Keybinding
default
vim
emacs
Markup
Markdown
Plain Text
Pod
RDoc
reStructuredText
AsciiDoc
BibTeX
Creole
MediaWiki
Org-mode
Textile
Help 1
Help 1
Help 1
Help 2
Help 3
Help 4
Help 5
Help 6
Help 7
Help 8
Autosaved text is available. Click the button to restore it.
Restore Text
--- title: JenkinsMultibranchPipelineWithGitTagDiscovery --- Jenkins Multibranch Pipeline with Git Tag Discovery Be default [Jenkins][1] [multibranch pipelines][2] with git [won't discover and build tags][3]. Following on from [R Tyler Croy][4]'s post about [pipelines with git tags][5]. Here's how you generate a job like that in [JobDSL][6]. The key is that you can't use the obvious `branchSources / git` API. It's a nice shortcut but it doesn't have a `traits` property. But` branchSources / branchSource / source / git`, however, does! multibranchPipelineJob('my_repo') { factory { workflowBranchProjectFactory { scriptPath('Jenkinsfile') } } branchSources { branchSource { source { git { remote(git_url) credentialsId('my\_credential\_id') traits { gitBranchDiscovery() gitTagDiscovery() // be careful you don't create a build storm! headWildcardFilter { includes('my\_branch1 my\_branches* my_tags* ) excludes('') } } } } } } } [1]: https://jenkins.io/ [2]: https://wiki.jenkins.io/display/JENKINS/Pipeline+Multibranch+Plugin [3]: https://issues.jenkins-ci.org/browse/JENKINS-47496 [4]: https://brokenco.de/ [5]: https://jenkins.io/blog/2018/05/16/pipelines-with-git-tags/ [6]: https://jenkinsci.github.io/job-dsl-plugin/ [7]: JenkinsMultibranchPipelineWithGitTagDiscovery?action=sourceblock&num=1 <!-- vim: filetype=markdown -->
Uploading file...
Sidebar
# SideBar * [Home][1] * [Projects][2] * * * <!-- --> * [Code][3] * [Tech][4] * [Network][5] * [MediaCentre][6] * [UAV][7] * * * <!-- --> * [Travel][8] * [Music][9] * [Horse Riding][10] * [Study][11] * [Games][12] * [Other Activities][13] * * * <!-- --> * [Car][14] * [House][15] * [Watch][16] * [Clothing][17] * [Miscellany][18] * * * [1]: /Home [2]: /Projects [3]: /Code/Code [4]: /Tech/Tech [5]: /Network/Network [6]: /MediaCentre/MediaCentre [7]: /UAV/UAV [8]: /Travel/Travel [9]: /Music/Music [10]: /HorseRiding/HorseRiding [11]: /Study/Study [12]: /Games/Games [13]: /Do/Do [14]: /Car/Car [15]: /House/House [16]: /Watch/Watch [17]: /Clothing/Clothing [18]: /Miscellany/Miscellany <!-- vim: filetype=markdown -->
Edit message:
Cancel