summaryrefslogtreecommitdiffstats
path: root/tests/yamlparser/fixtures/jinja-string04.yaml
blob: 436ed55a74e80d917dd1cbde2a6333a8be0e0621 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# Make sure Jinja subsittuions work from within "defaults"
- defaults:
    name: test-defaults
    test_var:
      !j2: "{% for x in [1, 2, 3] %}{{ x }}{% endfor %}"
    use_test_builder: true
    test_builder_name:
      !j2: |
        {% if use_test_builder -%}
          test-shell-builder-alternate
        {%- else -%}
          test-shell-builder-default
        {%- endif %}

- project:
    name: test-proj
    jobs:
      - test-jobs-{argument}:
          argument:
            - 1

# This type of variable propagation only works in job templates.
- job-template:
    name: test-jobs-{argument}
    defaults: test-defaults
    builders:
      # This fails because we only render the initial template, not the final template.
      - "{test_builder_name}":
          test_var: "{test_var}"

- builder:
    name: test-shell-builder-alternate
    builders:
      - shell: "{test_var}"


- builder:
    name: test-shell-builder-default
    builders:
      - shell: "default"