summaryrefslogtreecommitdiffstats
path: root/tests/yamlparser/fixtures/jinja-string01.yaml
diff options
context:
space:
mode:
authorDaniel Watkins <daniel.watkins@canonical.com>2018-02-21 20:42:36 -0500
committerDaniel Watkins <daniel.watkins@canonical.com>2018-02-21 20:49:22 -0500
commitd6c8111f66fd09f5d694ddf2de6d2e22b32c7dc4 (patch)
tree80abe30fd38ce973703e1b3dc2a8c1d19ffac801 /tests/yamlparser/fixtures/jinja-string01.yaml
parent5579395bc3c7d4baea9c3792b977f2a2a484004c (diff)
downloadpython-jenkins-job-builder-d6c8111f66fd09f5d694ddf2de6d2e22b32c7dc4.tar.gz
python-jenkins-job-builder-d6c8111f66fd09f5d694ddf2de6d2e22b32c7dc4.tar.xz
python-jenkins-job-builder-d6c8111f66fd09f5d694ddf2de6d2e22b32c7dc4.zip
Add !j2 directive to allow inline Jinja2 templates
This enables the use of Jinja2 templating within strings in the template YAML files. Change-Id: I2e912d2f874c5f2428e1aed4af94897aee8d4a72
Diffstat (limited to 'tests/yamlparser/fixtures/jinja-string01.yaml')
-rw-r--r--tests/yamlparser/fixtures/jinja-string01.yaml19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/yamlparser/fixtures/jinja-string01.yaml b/tests/yamlparser/fixtures/jinja-string01.yaml
new file mode 100644
index 00000000..70e64238
--- /dev/null
+++ b/tests/yamlparser/fixtures/jinja-string01.yaml
@@ -0,0 +1,19 @@
+- builder:
+ name: test-builder
+ builders:
+ - shell:
+ !j2: |
+ {{ var }}
+ {% for item in test_list -%}
+ {{ item }}
+ {% endfor %}
+
+- job:
+ name: test-job
+ builders:
+ - test-builder:
+ var: "test variable"
+ test_list:
+ - a
+ - b
+ - c