-
Improvement
-
Resolution: Fixed
-
Minor
The job-dsl-plugin does not support the `Branch Sources > Property Strategy` and `Build Configuration > Script Path` options for multi-branch pipeline projects.
It would useful to be able to specify these in the DSL similar to these examples:
Apply Default Property Strategy to a Branch Source
multibranchPipelineJob("my_awesome_job") { displayName "my awesome job" description "multi-branch pipeline job thingy" branchSources { git { remote('https://github.com/jenkinsci/job-dsl-plugin.git') credentialsId('github-ci') includes('JENKINS-*') // set the default property strategy defaultBranchPropertyStrategy { noTriggerBranchProperty() } } } }
Apply Named Branch Property Strategy to a Branch Source
multibranchPipelineJob("my_awesome_job") { displayName "my awesome job" description "multi-branch pipeline job thingy" branchSources { git { remote('https://github.com/jenkinsci/job-dsl-plugin.git') credentialsId('github-ci') includes('JENKINS-*') // set the named branch property strategy namedExceptionsBranchPropertyStrategy { // only trigger branch build for the `master` branch defaultProperties { noTriggerBranchProperty() } namedException { // could include noTriggerBranchProperty() here if there was no default properties branch('master') } } } } }
Set Script Path for the Project Factory
multibranchPipelineJob("my_awesome_job") { displayName "my awesome job" description "multi-branch pipeline job thingy" branchSources { git { remote('https://github.com/jenkinsci/job-dsl-plugin.git') credentialsId('github-ci') includes('JENKINS-*') } } factory { workflowBranchProjectFactory { scriptPath('pipelines/entryPoint.groovy') } } }
[JENKINS-49615] multibranchPipelineJob: add property strategy & script path options
Description |
Original:
The job-dsl-plugin does not support the `Branch Sources > Property Strategy` and `Build Configuration > Script Path` options for multi-branch pipeline projects. It would useful to be able to specify these in the DSL similar to these examples: {code:groovy} multibranchPipelineJob("my_awesome_job") { displayName "my awesome job" description "multi-branch pipeline job thingy" branchSources { git { remote('https://github.com/jenkinsci/job-dsl-plugin.git') credentialsId('github-ci') includes('JENKINS-*') // set the default property strategy defaultBranchPropertyStrategy { noTriggerBranchProperty() } } } } {code} |
New:
The job-dsl-plugin does not support the `Branch Sources > Property Strategy` and `Build Configuration > Script Path` options for multi-branch pipeline projects. It would useful to be able to specify these in the DSL similar to these examples: *Apply Default Property Strategy to a Branch Source* {code:java} multibranchPipelineJob("my_awesome_job") { displayName "my awesome job" description "multi-branch pipeline job thingy" branchSources { git { remote('https://github.com/jenkinsci/job-dsl-plugin.git') credentialsId('github-ci') includes('JENKINS-*') // set the default property strategy defaultBranchPropertyStrategy { noTriggerBranchProperty() } } } } {code} *Apply Named Branch Property Strategy to a Branch Source* {code:java} multibranchPipelineJob("my_awesome_job") { displayName "my awesome job" description "multi-branch pipeline job thingy" branchSources { git { remote('https://github.com/jenkinsci/job-dsl-plugin.git') credentialsId('github-ci') includes('JENKINS-*') // set the named branch property strategy namedExceptionsBranchPropertyStrategy { // only trigger branch build for the `master` branch defaultProperties { noTriggerBranchProperty() } namedException { // could include noTriggerBranchProperty() here if there was no default properties branch('master') } } } } } {code} *Set Script Path for the Project Factory* {code:java} multibranchPipelineJob("my_awesome_job") { displayName "my awesome job" description "multi-branch pipeline job thingy" branchSources { git { remote('https://github.com/jenkinsci/job-dsl-plugin.git') credentialsId('github-ci') includes('JENKINS-*') } } factory { workflowBranchProjectFactory { scriptPath('pipelines/entryPoint.groovy') } } } {code} |
Status | Original: Open [ 1 ] | New: In Progress [ 3 ] |
Assignee | Original: matthew snoddy [ djfdyuruiry ] | New: Daniel Spilker [ daspilker ] |
Resolution | New: Fixed [ 1 ] | |
Status | Original: In Progress [ 3 ] | New: Resolved [ 5 ] |
Status | Original: Resolved [ 5 ] | New: Closed [ 6 ] |