diff options
author | Darragh Bailey <daragh.bailey@gmail.com> | 2014-06-15 16:48:26 +0100 |
---|---|---|
committer | Darragh Bailey <daragh.bailey@gmail.com> | 2014-06-20 23:16:23 +0100 |
commit | 3e3996d32ac7b5504efe32c46e096cdbf4941b20 (patch) | |
tree | 465fb6e4f3e91a8d678bd8e407fe29fb0f52bad1 /tests/yamlparser/fixtures/include001.yaml | |
parent | 18a07f107719574b318d56a29b135976c53352b7 (diff) | |
download | python-jenkins-job-builder-3e3996d32ac7b5504efe32c46e096cdbf4941b20.tar.gz python-jenkins-job-builder-3e3996d32ac7b5504efe32c46e096cdbf4941b20.tar.xz python-jenkins-job-builder-3e3996d32ac7b5504efe32c46e096cdbf4941b20.zip |
Use yaml local tags to support including files
Add support for local tags which are application specific to allow
including of other yaml files or code from scripts. Allows for code to
be maintained and tested as seperate files, as well as reduces
duplication of yaml code that cannot be macro'ed or easily templated by
including it from a common file.
Adds support for the following tags:
'include' - load file as yaml code
'include-raw' - load file as data (for scripts)
'include-raw-escaped' - load file as data with escaping braces '{}'
as default for use with job-templates
Use configuration file options to provide a search path for the files.
- Test behaviour of yaml tags independent of any XML generation
by comparing json result of yaml parsing to verify that certain
tags do/don't recall the yaml.load() method.
- Add examples for the include tags via addition tests for YamlParser
class
Inspired by
http://stackoverflow.com/questions/528281/how-can-i-include-an-yaml-file-inside-another
Change-Id: Ib90a07043112d4739d6529ceddbc9817668bcec0
Diffstat (limited to 'tests/yamlparser/fixtures/include001.yaml')
-rw-r--r-- | tests/yamlparser/fixtures/include001.yaml | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/tests/yamlparser/fixtures/include001.yaml b/tests/yamlparser/fixtures/include001.yaml new file mode 100644 index 00000000..85a54525 --- /dev/null +++ b/tests/yamlparser/fixtures/include001.yaml @@ -0,0 +1,46 @@ +# vim: sw=4 ts=4 et +- wrapper: + name: timeout-wrapper + wrappers: + - timeout: + fail: true + elastic-percentage: 150 + elastic-default-timeout: 90 + type: elastic + +- wrapper: + name: pre-scm-shell-ant + wrappers: + - pre-scm-buildstep: + - shell: | + #!/bin/bash + echo "Doing somethiung cool" + - shell: | + #!/bin/zsh + echo "Doing somethin cool with zsh" + - ant: "target1 target2" + ant-name: "Standard Ant" + - inject: + properties-file: example.prop + properties-content: EXAMPLE=foo-bar + +- wrapper: + name: copy-files + wrappers: + - copy-to-slave: + includes: + - file1 + - file2*.txt + excludes: + - file2bad.txt + + +- job: + name: test-job-1 + wrappers: + !include include001.yaml.inc + properties: + - inject: + keep-build-variables: true + keep-system-variables: true + |