Debian Codegraph @

tests/yamlparser/job_fixtures/jinja-string04.yaml

raw symbols SCIP
1 # Make sure Jinja subsittuions work from within "defaults"
2 - defaults:
3 name: test-defaults
4 test_var:
5 !j2: "{% for x in [1, 2, 3] %}{{ x }}{% endfor %}"
6 use_test_builder: true
7 test_builder_name:
8 !j2: |
9 {% if use_test_builder -%}
10 test-shell-builder-alternate
11 {%- else -%}
12 test-shell-builder-default
13 {%- endif %}
14
15 - project:
16 name: test-proj
17 jobs:
18 - test-jobs-{argument}:
19 argument:
20 - 1
21
22 # This type of variable propagation only works in job templates.
23 - job-template:
24 name: test-jobs-{argument}
25 defaults: test-defaults
26 builders:
27 # This fails because we only render the initial template, not the final template.
28 - "{test_builder_name}":
29 test_var: "{test_var}"
30
31 - builder:
32 name: test-shell-builder-alternate
33 builders:
34 - shell: "{test_var}"
35
36
37 - builder:
38 name: test-shell-builder-default
39 builders:
40 - shell: "default"