Enable whitelisted-orgs-as-admins for ghprb trigger

Adds support for having all members of a
whitelisted organization automatically have
admin rights for the github pull request builder
trigger.  Details on this functionality can be found
at https://wiki.jenkins-ci.org/display/JENKINS/
GitHub+pull+request+builder+plugin

Change-Id: Ieca5a789a79d1ad91783fcd4608d26a8d6d61878
This commit is contained in:
Barnaby Court 2015-02-18 11:10:36 -05:00
parent d67f5f73a2
commit 6033c80457
3 changed files with 6 additions and 0 deletions

View File

@ -670,6 +670,8 @@ def github_pull_request(parser, xml_parent, data):
:arg list admin-list: the users with admin rights (optional)
:arg list white-list: users whose pull requests build (optional)
:arg list org-list: orgs whose users should be white listed (optional)
:arg bool allow-whitelist-orgs-as-admins: members of white listed orgs
will have admin rights. (default false)
:arg string cron: cron syntax of when to run (optional)
:arg string trigger-phrase: when filled, commenting this phrase
in the pull request will trigger a build (optional)
@ -695,6 +697,8 @@ def github_pull_request(parser, xml_parent, data):
XML.SubElement(ghprb, 'spec').text = data.get('cron', '')
admin_string = "\n".join(data.get('admin-list', []))
XML.SubElement(ghprb, 'adminlist').text = admin_string
XML.SubElement(ghprb, 'allowMembersOfWhitelistedOrgsAsAdmin').text = str(
data.get('allow-whitelist-orgs-as-admins', False)).lower()
white_string = "\n".join(data.get('white-list', []))
XML.SubElement(ghprb, 'whitelist').text = white_string
org_string = "\n".join(data.get('org-list', []))

View File

@ -5,6 +5,7 @@
<spec>* * * * *</spec>
<adminlist>user1
user2</adminlist>
<allowMembersOfWhitelistedOrgsAsAdmin>true</allowMembersOfWhitelistedOrgsAsAdmin>
<whitelist>user3
user4</whitelist>
<orgslist>org1

View File

@ -15,6 +15,7 @@ triggers:
github-hooks: true
permit-all: false
auto-close-on-fail: false
allow-whitelist-orgs-as-admins: true
white-list-target-branches:
- master
- testing