Browse Source

Merge "Support SSHCheckout trait"

tags/2.5.0
Zuul 10 months ago
parent
commit
8bc2ad3b62

+ 8
- 0
jenkins_jobs/modules/project_multibranch.py View File

@@ -660,6 +660,7 @@ def github_scm(xml_parent, data):
660 660
 
661 661
     :arg str api-uri: The GitHub API uri for hosted / on-site GitHub. Must
662 662
         first be configured in Global Configuration. (default GitHub)
663
+    :arg bool ssh-checkout: Checkout over SSH. (default false)
663 664
     :arg str credentials-id: Credentials used to scan branches and pull
664 665
         requests, check out sources and mark commit statuses. (optional)
665 666
     :arg str repo-owner: Specify the name of the GitHub Organization or
@@ -735,6 +736,13 @@ def github_scm(xml_parent, data):
735 736
         helpers.convert_mapping_to_xml(
736 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 746
     if data.get('discover-tags', False):
739 747
         XML.SubElement(
740 748
             traits, ''.join([

+ 1
- 0
tests/multibranch/fixtures/scm_github_full.xml View File

@@ -41,6 +41,7 @@
41 41
             <org.jenkinsci.plugins.github__branch__source.BranchDiscoveryTrait>
42 42
               <strategyId>3</strategyId>
43 43
             </org.jenkinsci.plugins.github__branch__source.BranchDiscoveryTrait>
44
+            <org.jenkinsci.plugins.github__branch__source.SSHCheckoutTrait/>
44 45
             <org.jenkinsci.plugins.github__branch__source.TagDiscoveryTrait/>
45 46
             <org.jenkinsci.plugins.github__branch__source.ForkPullRequestDiscoveryTrait>
46 47
               <strategyId>3</strategyId>

+ 1
- 0
tests/multibranch/fixtures/scm_github_full.yaml View File

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

Loading…
Cancel
Save