We have got a Jenkins setup (at the moment not managed with the Jenkins Job Builder) where every web project has 5 very similar Jenkins jobs. This is a simplified Jenkins Job Builder yaml file which could work for our needs:
- defaults:
name: global
project-type: 'freestyle'
disabled: false
buildTargets: 'build'
- job-template:
name: '{jobNameFirstSegment}-{jobNameSecondSegment}'
defaults: global
builders:
- ant:
targets: '{buildTargets}'
buildfile: 'build.xml'
- project:
name: lorem
jobNameFirstSegment:
- foo:
displayNameFirstSegment: 'Foo'
urlGitRepository: 'git@bitbucket.org:mycompany/foo.git'
- bar:
displayNameFirstSegment: 'Bar'
urlGitRepository: 'git@bitbucket.org:mycompany/bar.git'
- baz:
displayNameFirstSegment: 'Baz'
urlGitRepository: 'git@bitbucket.org:mycompany/baz.git'
jobNameSecondSegment:
- lorem:
buildTargets: 'build-lorem'
- ipsum:
buildTargets: 'build-ipsum'
- dolor:
buildTargets: 'build-dolor'
- sit:
buildTargets: 'build-sit'
- amet:
buildTargets: 'build-amet'
jobs:
- '{jobNameFirstSegment}-{jobNameSecondSegment}'
This yaml file results in 15 Jenkins jobs - all are NOT disabled:
- foo-lorem
- foo-ipsum
- foo-dolor
- foo-sit
- foo-amet
- bar-lorem
- bar-ipsum
- bar-dolor
- bar-sit
- bar-amet
- baz-lorem
- baz-ipsum
- baz-dolor
- baz-sit
- baz-amet
Is it possible with this kind of setup to disable a specific Jenkins job? I could not find out how to override the "disabled" attribute for e.g. the Jenkins job "foo-lorem". How can this be achieved?
Infact we would need to have the possibility to be able to override any attribute of any Jenkins job if needed. Is this doable? How?