scm: introduce parent-credentials for git submodules
Jenkins Git plugin does not use your configured credentials for cloning submodules, but you can told it to use credentials from parent repository, by checking "Use credentials from default remote of parent repository", and this "parent-credentials" will set that option. So without this option jenkins git plugin will not be able to clone submodules, if they are not public available. The default value is "false", like in jenkins git plugin. See-also: https://issues.jenkins-ci.org/browse/JENKINS-20941 Change-Id: I1cfb3f45bb082f538eff1a9e64a03be27f759a5f Signed-off-by: Azat Khuzhin <a3at.mail@gmail.com>
This commit is contained in:
parent
4f77324fea
commit
9e51beb804
@ -181,6 +181,8 @@ def git(registry, xml_parent, data):
|
|||||||
* **tracking** (`bool`) - Retrieve the tip of the configured
|
* **tracking** (`bool`) - Retrieve the tip of the configured
|
||||||
branch in .gitmodules (Uses '\-\-remote' option which requires
|
branch in .gitmodules (Uses '\-\-remote' option which requires
|
||||||
git>=1.8.2)
|
git>=1.8.2)
|
||||||
|
* **parent-credentials** (`bool`) - Use credentials from default
|
||||||
|
remote of parent repository (default false).
|
||||||
* **reference-repo** (`str`) - Path of the reference repo to use
|
* **reference-repo** (`str`) - Path of the reference repo to use
|
||||||
during clone (optional)
|
during clone (optional)
|
||||||
* **timeout** (`int`) - Specify a timeout (in minutes) for
|
* **timeout** (`int`) - Specify a timeout (in minutes) for
|
||||||
@ -396,6 +398,8 @@ def git(registry, xml_parent, data):
|
|||||||
data['submodule'].get('recursive', False)).lower()
|
data['submodule'].get('recursive', False)).lower()
|
||||||
XML.SubElement(ext, 'trackingSubmodules').text = str(
|
XML.SubElement(ext, 'trackingSubmodules').text = str(
|
||||||
data['submodule'].get('tracking', False)).lower()
|
data['submodule'].get('tracking', False)).lower()
|
||||||
|
XML.SubElement(ext, 'parentCredentials').text = str(
|
||||||
|
data['submodule'].get('parent-credentials', False)).lower()
|
||||||
XML.SubElement(ext, 'reference').text = str(
|
XML.SubElement(ext, 'reference').text = str(
|
||||||
data['submodule'].get('reference-repo', ''))
|
data['submodule'].get('reference-repo', ''))
|
||||||
XML.SubElement(ext, 'timeout').text = str(
|
XML.SubElement(ext, 'timeout').text = str(
|
||||||
|
@ -42,6 +42,7 @@
|
|||||||
<disableSubmodules>false</disableSubmodules>
|
<disableSubmodules>false</disableSubmodules>
|
||||||
<recursiveSubmodules>true</recursiveSubmodules>
|
<recursiveSubmodules>true</recursiveSubmodules>
|
||||||
<trackingSubmodules>false</trackingSubmodules>
|
<trackingSubmodules>false</trackingSubmodules>
|
||||||
|
<parentCredentials>false</parentCredentials>
|
||||||
<reference/>
|
<reference/>
|
||||||
<timeout>10</timeout>
|
<timeout>10</timeout>
|
||||||
</hudson.plugins.git.extensions.impl.SubmoduleOption>
|
</hudson.plugins.git.extensions.impl.SubmoduleOption>
|
||||||
|
@ -26,6 +26,7 @@
|
|||||||
<disableSubmodules>true</disableSubmodules>
|
<disableSubmodules>true</disableSubmodules>
|
||||||
<recursiveSubmodules>true</recursiveSubmodules>
|
<recursiveSubmodules>true</recursiveSubmodules>
|
||||||
<trackingSubmodules>true</trackingSubmodules>
|
<trackingSubmodules>true</trackingSubmodules>
|
||||||
|
<parentCredentials>true</parentCredentials>
|
||||||
<reference>/jenkins_home/.gitcache/submodules</reference>
|
<reference>/jenkins_home/.gitcache/submodules</reference>
|
||||||
<timeout>15</timeout>
|
<timeout>15</timeout>
|
||||||
</hudson.plugins.git.extensions.impl.SubmoduleOption>
|
</hudson.plugins.git.extensions.impl.SubmoduleOption>
|
||||||
|
@ -5,5 +5,6 @@ scm:
|
|||||||
disable: true
|
disable: true
|
||||||
recursive: true
|
recursive: true
|
||||||
tracking: true
|
tracking: true
|
||||||
|
parent-credentials: true
|
||||||
reference-repo: /jenkins_home/.gitcache/submodules
|
reference-repo: /jenkins_home/.gitcache/submodules
|
||||||
timeout: 15
|
timeout: 15
|
||||||
|
Loading…
Reference in New Issue
Block a user