Merge "ghprb: blacklist-target-branches support"
This commit is contained in:
commit
2801467eb9
@ -965,6 +965,10 @@ def github_pull_request(registry, xml_parent, data):
|
||||
allows you to selectively test pull requests destined for these
|
||||
branches only. Supports regular expressions (e.g. 'master',
|
||||
'feature-.*'). (optional)
|
||||
:arg list black-list-target-branches: Adding branches to this blacklist
|
||||
allows you to selectively prevent pull requests builds destined for
|
||||
these branches. Supports regular expressions (e.g. 'master',
|
||||
'feature-.*'). (optional)
|
||||
:arg string auth-id: the auth id to use (optional)
|
||||
:arg string build-desc-template: the template for build descriptions in
|
||||
jenkins (optional)
|
||||
@ -1058,6 +1062,14 @@ def github_pull_request(registry, xml_parent, data):
|
||||
'ghprb.GhprbBranch')
|
||||
XML.SubElement(be, 'branch').text = str(branch)
|
||||
|
||||
black_list_target_branches = data.get('black-list-target-branches', [])
|
||||
if black_list_target_branches:
|
||||
ghprb_bltb = XML.SubElement(ghprb, 'blackListTargetBranches')
|
||||
for branch in black_list_target_branches:
|
||||
be = XML.SubElement(ghprb_bltb, 'org.jenkinsci.plugins.'
|
||||
'ghprb.GhprbBranch')
|
||||
XML.SubElement(be, 'branch').text = str(branch)
|
||||
|
||||
auth_id = data.get('auth-id', '')
|
||||
if auth_id:
|
||||
XML.SubElement(ghprb, 'gitHubAuthId').text = str(auth_id)
|
||||
|
@ -34,6 +34,14 @@ region</includedRegions>
|
||||
<branch>testing</branch>
|
||||
</org.jenkinsci.plugins.ghprb.GhprbBranch>
|
||||
</whiteListTargetBranches>
|
||||
<blackListTargetBranches>
|
||||
<org.jenkinsci.plugins.ghprb.GhprbBranch>
|
||||
<branch>master</branch>
|
||||
</org.jenkinsci.plugins.ghprb.GhprbBranch>
|
||||
<org.jenkinsci.plugins.ghprb.GhprbBranch>
|
||||
<branch>testing</branch>
|
||||
</org.jenkinsci.plugins.ghprb.GhprbBranch>
|
||||
</blackListTargetBranches>
|
||||
<gitHubAuthId>123-456-789</gitHubAuthId>
|
||||
<extensions>
|
||||
<org.jenkinsci.plugins.ghprb.extensions.status.GhprbSimpleStatus>
|
||||
|
@ -27,6 +27,9 @@ triggers:
|
||||
white-list-target-branches:
|
||||
- master
|
||||
- testing
|
||||
black-list-target-branches:
|
||||
- master
|
||||
- testing
|
||||
auth-id: '123-456-789'
|
||||
status-context: "status context"
|
||||
triggered-status: "triggered status message"
|
||||
|
Loading…
Reference in New Issue
Block a user