diff options
author | Daniel Watkins <daniel.watkins@canonical.com> | 2018-02-21 20:42:36 -0500 |
---|---|---|
committer | Daniel Watkins <daniel.watkins@canonical.com> | 2018-02-21 20:49:22 -0500 |
commit | d6c8111f66fd09f5d694ddf2de6d2e22b32c7dc4 (patch) | |
tree | 80abe30fd38ce973703e1b3dc2a8c1d19ffac801 /tests/yamlparser/fixtures/jinja-string01.yaml | |
parent | 5579395bc3c7d4baea9c3792b977f2a2a484004c (diff) | |
download | python-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.yaml | 19 |
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 |