summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.openstack.org>2018-09-16 18:51:25 +0000
committerGerrit Code Review <review@openstack.org>2018-09-16 18:51:25 +0000
commit8bc2ad3b6223eac653cce6fff2c38bc8985d5713 (patch)
tree38f5c4dd0173520e16ded8ea3959d40c70734a3e
parentdca93849edd718297592b96fcd10fa06c85aaa6d (diff)
parentd076675ca144d7855dff6805b05d09c87d904178 (diff)
Merge "Support SSHCheckout trait"
-rw-r--r--jenkins_jobs/modules/project_multibranch.py8
-rw-r--r--tests/multibranch/fixtures/scm_github_full.xml1
-rw-r--r--tests/multibranch/fixtures/scm_github_full.yaml1
3 files changed, 10 insertions, 0 deletions
diff --git a/jenkins_jobs/modules/project_multibranch.py b/jenkins_jobs/modules/project_multibranch.py
index 8137550..11a5286 100644
--- a/jenkins_jobs/modules/project_multibranch.py
+++ b/jenkins_jobs/modules/project_multibranch.py
@@ -660,6 +660,7 @@ def github_scm(xml_parent, data):
660 660
661 :arg str api-uri: The GitHub API uri for hosted / on-site GitHub. Must 661 :arg str api-uri: The GitHub API uri for hosted / on-site GitHub. Must
662 first be configured in Global Configuration. (default GitHub) 662 first be configured in Global Configuration. (default GitHub)
663 :arg bool ssh-checkout: Checkout over SSH. (default false)
663 :arg str credentials-id: Credentials used to scan branches and pull 664 :arg str credentials-id: Credentials used to scan branches and pull
664 requests, check out sources and mark commit statuses. (optional) 665 requests, check out sources and mark commit statuses. (optional)
665 :arg str repo-owner: Specify the name of the GitHub Organization or 666 :arg str repo-owner: Specify the name of the GitHub Organization or
@@ -735,6 +736,13 @@ def github_scm(xml_parent, data):
735 helpers.convert_mapping_to_xml( 736 helpers.convert_mapping_to_xml(
736 bd, data, bd_mapping, fail_required=True) 737 bd, data, bd_mapping, fail_required=True)
737 738
739 if data.get('ssh-checkout', False):
740 XML.SubElement(
741 traits, ''.join([
742 github_path_dscore, '.SSHCheckoutTrait'
743 ])
744 )
745
738 if data.get('discover-tags', False): 746 if data.get('discover-tags', False):
739 XML.SubElement( 747 XML.SubElement(
740 traits, ''.join([ 748 traits, ''.join([
diff --git a/tests/multibranch/fixtures/scm_github_full.xml b/tests/multibranch/fixtures/scm_github_full.xml
index 7fac146..9786847 100644
--- a/tests/multibranch/fixtures/scm_github_full.xml
+++ b/tests/multibranch/fixtures/scm_github_full.xml
@@ -41,6 +41,7 @@
41 <org.jenkinsci.plugins.github__branch__source.BranchDiscoveryTrait> 41 <org.jenkinsci.plugins.github__branch__source.BranchDiscoveryTrait>
42 <strategyId>3</strategyId> 42 <strategyId>3</strategyId>
43 </org.jenkinsci.plugins.github__branch__source.BranchDiscoveryTrait> 43 </org.jenkinsci.plugins.github__branch__source.BranchDiscoveryTrait>
44 <org.jenkinsci.plugins.github__branch__source.SSHCheckoutTrait/>
44 <org.jenkinsci.plugins.github__branch__source.TagDiscoveryTrait/> 45 <org.jenkinsci.plugins.github__branch__source.TagDiscoveryTrait/>
45 <org.jenkinsci.plugins.github__branch__source.ForkPullRequestDiscoveryTrait> 46 <org.jenkinsci.plugins.github__branch__source.ForkPullRequestDiscoveryTrait>
46 <strategyId>3</strategyId> 47 <strategyId>3</strategyId>
diff --git a/tests/multibranch/fixtures/scm_github_full.yaml b/tests/multibranch/fixtures/scm_github_full.yaml
index 544fcdc..6eb63c6 100644
--- a/tests/multibranch/fixtures/scm_github_full.yaml
+++ b/tests/multibranch/fixtures/scm_github_full.yaml
@@ -4,6 +4,7 @@ script-path: some.Jenkinsfile
4scm: 4scm:
5 - github: 5 - github:
6 api-uri: http://example.org/github 6 api-uri: http://example.org/github
7 ssh-checkout: true
7 repo: example-repo 8 repo: example-repo
8 repo-owner: example-owner 9 repo-owner: example-owner
9 credentials-id: example-credential 10 credentials-id: example-credential