summaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorThanh Ha <thanh.ha@linuxfoundation.org>2016-11-09 12:03:01 -0500
committerSorin Sbarnea <ssbarnea@redhat.com>2018-04-12 19:42:31 +0100
commit418e7c628d5cec543c086f3acd4a86ee64265e20 (patch)
tree1a6a0e314241081dd8787ffb7f9cac6a7820d836 /doc
parentb72235c462cbbd48f4673c47a157d3ce112cc554 (diff)
downloadpython-jenkins-job-builder-418e7c628d5cec543c086f3acd4a86ee64265e20.tar.gz
python-jenkins-job-builder-418e7c628d5cec543c086f3acd4a86ee64265e20.tar.xz
python-jenkins-job-builder-418e7c628d5cec543c086f3acd4a86ee64265e20.zip
Add support for view-templates
Allow views to also be configured via templates similar to job-templates. This adds a new project key called "views" and parser type called "view-template" allowing the user to add custom views. Example: - view-template: name: '{name}-template-{seq}' description: 'testing view templates feature' view-type: list regex: 'test-view-.*' - project: name: 'test-view' views: - '{name}-template-{seq}' seq: - a - b - c Change-Id: I6eb225f24bc3c7d790c7dcab6391735c579ac71a Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
Diffstat (limited to 'doc')
-rw-r--r--doc/source/definition.rst27
1 files changed, 27 insertions, 0 deletions
diff --git a/doc/source/definition.rst b/doc/source/definition.rst
index 18485905..e7e582d7 100644
--- a/doc/source/definition.rst
+++ b/doc/source/definition.rst
@@ -201,6 +201,33 @@ create a view, you must define a view in a YAML file and have a variable called
Views are processed differently than Jobs and therefore will not work within a `Project`_ or a `Job Template`_.
+.. _view-template:
+
+View Template
+^^^^^^^^^^^^^
+
+Allow views to also be configured via templates similar to job-templates. This
+is useful when you have multiple views defined that have similar configuration
+except for a few variables. View Templates can be passed variables to fill in
+sections automatically via a project configuration using the new 'views' key.
+
+Minimal Example::
+
+ - view-template:
+ name: '{name}-template-{seq}'
+ description: 'testing view templates feature'
+ view-type: list
+ regex: 'test-view-.*'
+
+ - project:
+ name: 'test-view'
+ views:
+ - '{name}-template-{seq}'
+ seq:
+ - a
+ - b
+ - c
+
.. _macro:
Macro