diff options
author | Anil Belur <askb23@gmail.com> | 2018-03-10 22:21:56 +1000 |
---|---|---|
committer | Sorin Sbarnea <ssbarnea@redhat.com> | 2018-04-19 09:37:35 +0100 |
commit | ac345d0e6635d2809b730e3e659f369e3571511b (patch) | |
tree | c4a6e582da7331cf665d399b51b3e2ffaa15c4b1 /jenkins_jobs/modules/view_list.py | |
parent | 8811c514bd98dac9b96e9c3cca1394936b90188e (diff) | |
download | python-jenkins-job-builder-ac345d0e6635d2809b730e3e659f369e3571511b.tar.gz python-jenkins-job-builder-ac345d0e6635d2809b730e3e659f369e3571511b.tar.xz python-jenkins-job-builder-ac345d0e6635d2809b730e3e659f369e3571511b.zip |
Add support for upstream downstream job filter
Add support for upstream downstream job filter for views.
Change-Id: I8869f804a6f85f8bee7720d785f03492c87ff959
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.py | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/jenkins_jobs/modules/view_list.py b/jenkins_jobs/modules/view_list.py index 1d17b434..e9946f95 100644 --- a/jenkins_jobs/modules/view_list.py +++ b/jenkins_jobs/modules/view_list.py @@ -187,6 +187,17 @@ to the :ref:`view_list` definition. * **permission-check**: ('str'): Match user permissions. (default MustMatchAll) + * **upstream-downstream** (`dict`) + :upstream-downstream: + * **include-upstream** ('bool'): Jobs that match upstream. + (default False) + * **include-downstream** ('bool'): Jobs that match downstream. + (default False) + * **recursive** ('bool'): Jobs that are recursive. + (default False) + * **exclude-originals** ('bool'): Jobs that are originals. + (default False) + * **columns** (`list`): List of columns to be shown in view. * **regex** (`str`): . Regular expression for selecting jobs (optional) @@ -325,6 +336,21 @@ class List(jenkins_jobs.modules.base.Base): convert_mapping_to_xml(js_xml, js_data, mapping, fail_required=True) + if jobfilter == 'upstream-downstream': + ud_xml = XML.SubElement(job_filter_xml, + 'hudson.views.UpstreamDownstreamJobsFilter') + ud_xml.set('plugin', 'view-job-filters') + ud_data = jobfilters.get('upstream-downstream') + mapping = [ + ('include-upstream', 'includeUpstream', + False), + ('include-downstream', 'includeDownstream', False), + ('recursive', 'recursive', False), + ('exclude-originals', 'excludeOriginals', False), + ] + convert_mapping_to_xml(ud_xml, ud_data, mapping, + fail_required=True) + if jobfilter == 'fallback': fb_xml = XML.SubElement(job_filter_xml, 'hudson.views.AddRemoveFallbackFilter') |