Merge "Support SSHCheckout trait"

This commit is contained in:
Zuul 2018-09-16 18:51:25 +00:00 committed by Gerrit Code Review
commit 8bc2ad3b62
3 changed files with 10 additions and 0 deletions

View File

@ -660,6 +660,7 @@ def github_scm(xml_parent, data):
:arg str api-uri: The GitHub API uri for hosted / on-site GitHub. Must
first be configured in Global Configuration. (default GitHub)
:arg bool ssh-checkout: Checkout over SSH. (default false)
:arg str credentials-id: Credentials used to scan branches and pull
requests, check out sources and mark commit statuses. (optional)
:arg str repo-owner: Specify the name of the GitHub Organization or
@ -735,6 +736,13 @@ def github_scm(xml_parent, data):
helpers.convert_mapping_to_xml(
bd, data, bd_mapping, fail_required=True)
if data.get('ssh-checkout', False):
XML.SubElement(
traits, ''.join([
github_path_dscore, '.SSHCheckoutTrait'
])
)
if data.get('discover-tags', False):
XML.SubElement(
traits, ''.join([

View File

@ -41,6 +41,7 @@
<org.jenkinsci.plugins.github__branch__source.BranchDiscoveryTrait>
<strategyId>3</strategyId>
</org.jenkinsci.plugins.github__branch__source.BranchDiscoveryTrait>
<org.jenkinsci.plugins.github__branch__source.SSHCheckoutTrait/>
<org.jenkinsci.plugins.github__branch__source.TagDiscoveryTrait/>
<org.jenkinsci.plugins.github__branch__source.ForkPullRequestDiscoveryTrait>
<strategyId>3</strategyId>

View File

@ -4,6 +4,7 @@ script-path: some.Jenkinsfile
scm:
- github:
api-uri: http://example.org/github
ssh-checkout: true
repo: example-repo
repo-owner: example-owner
credentials-id: example-credential