summaryrefslogtreecommitdiffstats
path: root/jenkins_jobs/modules/view_list.py
diff options
context:
space:
mode:
authorAnil Belur <askb23@gmail.com>2018-03-11 18:50:54 +1000
committerSorin Sbarnea <ssbarnea@redhat.com>2018-04-18 23:32:25 +0100
commit940466d7e032de40a0d35941075a716c7b16d0da (patch)
treea3d395cebcff4db48165c9a817b2ff9a0740a7f1 /jenkins_jobs/modules/view_list.py
parentd9f88828adcff7154c121e17fb49f8d0f7040e63 (diff)
downloadpython-jenkins-job-builder-940466d7e032de40a0d35941075a716c7b16d0da.tar.gz
python-jenkins-job-builder-940466d7e032de40a0d35941075a716c7b16d0da.tar.xz
python-jenkins-job-builder-940466d7e032de40a0d35941075a716c7b16d0da.zip
Add support for other views job filter
Add support for other views job filter for views. Change-Id: I80a8e82f8396df1dab2799781555c4a61942f34e Signed-off-by: Anil Belur <askb23@gmail.com>
Diffstat (limited to 'jenkins_jobs/modules/view_list.py')
-rw-r--r--jenkins_jobs/modules/view_list.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/jenkins_jobs/modules/view_list.py b/jenkins_jobs/modules/view_list.py
index ca556339..c991832c 100644
--- a/jenkins_jobs/modules/view_list.py
+++ b/jenkins_jobs/modules/view_list.py
@@ -155,6 +155,13 @@ to the :ref:`view_list` definition.
* **max-builds-to-match** ('int'): Maximum builds to match.
(default 0)
+ * **other-views** (`dict`)
+ :other-views:
+ * **match-type** ('str'): Jobs that match a filter
+ to include. (default includeMatched)
+ * **view-name** ('str'): View name.
+ (default select a view other than this one)
+
* **columns** (`list`): List of columns to be shown in view.
* **regex** (`str`): . Regular expression for selecting jobs
(optional)
@@ -393,6 +400,20 @@ class List(jenkins_jobs.modules.base.Base):
convert_mapping_to_xml(pr_xml, pr_data, mapping,
fail_required=True)
+ if jobfilter == 'other-views':
+ ov_xml = XML.SubElement(job_filter_xml,
+ 'hudson.views.OtherViewsFilter')
+ ov_xml.set('plugin', 'view-job-filters')
+ ov_data = jobfilters.get('other-views')
+ mapping = [
+ ('match-type', 'includeExcludeTypeString',
+ 'includeMatched'),
+ ('view-name', 'otherViewName',
+ '&lt;select a view other than this one&gt;'),
+ ]
+ convert_mapping_to_xml(ov_xml, ov_data, mapping,
+ fail_required=True)
+
c_xml = XML.SubElement(root, 'columns')
columns = data.get('columns', DEFAULT_COLUMNS)