configuring multibranchPipelineJob with JobDSL plugin

397 views
Skip to first unread message

j.kn...@travelaudience.com

unread,
Apr 3, 2019, 11:38:19 AM4/3/19
to Jenkins Users
I'm getting lost in the mixed documentation on how to manage the configuration of a multibranchPipelineJob with the Job DSL plugin.

Creating the job itself is straight forward, but when trying to recreate the Branch Sources for github as is possible in the UI, I'm not sure which patterns to follow.

First there is what seems to be the options provided by the jobdsl plugin for using multibranch pipeline: https://jenkinsci.github.io/job-dsl-plugin/#path/multibranchPipelineJob-branchSources-github
multibranchPipelineJob('example') {
    branchSources {
        github {
            scanCredentialsId('github-ci')
            repoOwner('OwnerName')
            repository('job-dsl-plugin')
            buildOriginBranch(true)
            buildOriginBranchWithPR(false)
            buildForkPRMerge(false)
            buildOriginPRHead(true)
            buildOriginPRMerge(true)
        }
    }
}
But these options don't cover most of the settings that are possible. For example, the Discover tags is not an option from these.

So, that's where the Dynamic DSL comes in, right?
and some of the options I'm looking for are now there, but the ones used before become deprecated. 
(see screenshot)

I also learned from a previous (non)bug[https://issues.jenkins-ci.org/browse/JENKINS-54456], that the configure option is not available in the github context, and so it's not possible to simply extend the functionality using that technique.

Screen Shot 2019-04-03 at 5.36.29 PM.png

j.kn...@travelaudience.com

unread,
Apr 4, 2019, 4:29:19 AM4/4/19
to Jenkins Users
I've cross posted in the https://groups.google.com/forum/#!forum/job-dsl-plugin email list, as it seems like a better place for this discussion 
(sorry, didn't know it existed beforehand)
Reply all
Reply to author
Forward
0 new messages