diff options
author | Darragh Bailey <daragh.bailey@gmail.com> | 2016-02-20 18:11:58 +0000 |
---|---|---|
committer | Darragh Bailey <daragh.bailey@gmail.com> | 2016-02-20 18:20:51 +0000 |
commit | a54e623dc79d1ac3b9b38148e012735cedc8b3ba (patch) | |
tree | 83b641ddf44d8446bfe335dfcc21804be36052dd /doc/source/definition.rst | |
parent | 398e28b3c33cf69aa0edc010e04b8a0946c9590b (diff) | |
download | python-jenkins-job-builder-a54e623dc79d1ac3b9b38148e012735cedc8b3ba.tar.gz python-jenkins-job-builder-a54e623dc79d1ac3b9b38148e012735cedc8b3ba.tar.xz python-jenkins-job-builder-a54e623dc79d1ac3b9b38148e012735cedc8b3ba.zip |
Document template variable default values
Document the ability to define default values for template variables
within the template definition thus removing the need to always having
to set such values in job definitions.
Change-Id: If4d8bfd898066b8e6350ed22f0c97eb939ae4348
Diffstat (limited to 'doc/source/definition.rst')
-rw-r--r-- | doc/source/definition.rst | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/doc/source/definition.rst b/doc/source/definition.rst index 51b190c7..ee5f16b0 100644 --- a/doc/source/definition.rst +++ b/doc/source/definition.rst @@ -74,6 +74,26 @@ Sometimes it is useful to have the same job name format used even where the template contents may vary. `Ids` provide a mechanism to support such use cases. + +Default Values for Template Variables +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +To facilitate reuse of templates with many variables that can be +substituted, but where in most cases the same or no value is needed, +it is possible to specify defaults for the variables within the +templates themselves. + +This can be used to provide common settings for particular templates. +For example: + +.. literalinclude:: + /../..tests/yamlparser/fixtures/template_default_variables.yaml + :language: yaml + +To use a default value for a variable used in the name would be +uncommon unless it was in addition to another variable. However you +can use `Ids`_ simplify such use cases. + .. _project: Project |