Examples of confusing behavior of Jenkins Job Builder.
$ jenkins-jobs --version
Jenkins Job Builder version: 3.10.0
- job-template:
name: '{foo}-{bar}'
- project:
name: derp
jobs:
- '{foo}-{bar}'
bar:
- x
- y
foo:
- a
- b
a-x
a-y
b-x
b-y
- defaults:
name: 'global'
foo:
- a
- b
- job-template:
name: '{foo}-{bar}'
- project:
name: derp
jobs:
- '{foo}-{bar}'
bar:
- x
- y
['a', 'b']-x
['a', 'b']-y
- job-template:
name: '{foo}-{bar}'
- project:
name: derp
jobs:
- '{foo}-{bar}'
bar:
- x
- y
foo: !include: foo.yaml.inc
- a
- b
a-x
a-y
b-x
b-y
- defaults:
name: 'global'
include_name: foo
- job-template:
name: '{foo}-{bar}'
- project:
name: derp
jobs:
- '{foo}-{bar}'
bar:
- x
- y
foo: !include: '{include_name}.yaml.inc'
- a
- b
['a', 'b']-x
['a', 'b']-y
- job-template:
name: '{foo}-{bar}'
- project:
name: derp
jobs:
- '{foo}-{bar}'
bar:
- x
- y
foo: !include: foo.yaml.inc
None-x
None-y
- job-template:
name: '{foo}-{bar}'
- project:
name: derp
jobs:
- '{foo}-{bar}'
bar:
- x
- y
foo: !include: foo.yaml.inc
[]
- job-template:
name: '{foo}-{bar}'
- project:
name: derp
jobs:
- '{foo}-{bar}'
bar:
- x
- y
configuration: !include: configuration.yaml.inc
foo: '{configuration[foo]}'
foo:
- a
- b
['a', 'b']-x
['a', 'b']-y
- defaults:
name: 'global'
foosrc:
- a
- b
- job-template:
name: '{foo}-{bar}'
- project:
name: derp
jobs:
- '{foo}-{bar}'
bar:
- x
- y
foo: '{foosrc}'
['a', 'b']-x
['a', 'b']-y
- defaults:
name: 'global'
release: N
- job-template:
name: '{foo}-{bar}'
- project:
name: derp
jobs:
- '{foo}-{bar}'
bar:
- x
- y
foo: !j2-yaml: |
{% if release == 'M' %}
- a
{% elif release == 'N' %}
- a
- b
{% else %}
[]
{% endif %}
['a', 'b']-x
['a', 'b']-y