Added code for lightweight-checkout
Implements: lightweight-checkout for pipeline projects Closes-Story: #2001717 Change-Id: I9bd63fba9a8f199e6b8c467c072d9804a44ec45d
This commit is contained in:
parent
efc5fbe0fd
commit
9d540666b2
@ -40,6 +40,9 @@ interpreted by the python str.format() command.
|
|||||||
source code repository
|
source code repository
|
||||||
* **script-path**: path to the Groovy file containing the job's steps
|
* **script-path**: path to the Groovy file containing the job's steps
|
||||||
(optional, default: ``Jenkinsfile``)
|
(optional, default: ``Jenkinsfile``)
|
||||||
|
* **lightweight-checkout** (`bool`): If selected, try to obtain the
|
||||||
|
Pipeline script contents directly from the SCM without performing a
|
||||||
|
full checkout. (optional, default: ``false``)
|
||||||
|
|
||||||
Note that ``dsl`` and ``pipeline-scm`` parameters are mutually exclusive.
|
Note that ``dsl`` and ``pipeline-scm`` parameters are mutually exclusive.
|
||||||
|
|
||||||
|
@ -1422,9 +1422,11 @@ class PipelineSCM(jenkins_jobs.modules.base.Base):
|
|||||||
raise JenkinsJobsException("'scm' missing or empty")
|
raise JenkinsJobsException("'scm' missing or empty")
|
||||||
elif scms_count == 1:
|
elif scms_count == 1:
|
||||||
self.registry.dispatch('scm', definition_parent, scms[0])
|
self.registry.dispatch('scm', definition_parent, scms[0])
|
||||||
XML.SubElement(definition_parent, 'scriptPath'
|
mapping = [('script-path', 'scriptPath', 'Jenkinsfile'),
|
||||||
).text = pipeline_dict.get('script-path',
|
('lightweight-checkout', 'lightweight', None,
|
||||||
'Jenkinsfile')
|
[True, False])]
|
||||||
|
convert_mapping_to_xml(definition_parent, pipeline_dict,
|
||||||
|
mapping, fail_required=False)
|
||||||
else:
|
else:
|
||||||
raise JenkinsJobsException('Only one SCM can be specified '
|
raise JenkinsJobsException('Only one SCM can be specified '
|
||||||
'as pipeline-scm')
|
'as pipeline-scm')
|
||||||
|
@ -11,6 +11,7 @@
|
|||||||
<disableChangeLog>false</disableChangeLog>
|
<disableChangeLog>false</disableChangeLog>
|
||||||
</scm>
|
</scm>
|
||||||
<scriptPath>Jenkinsfile.groovy</scriptPath>
|
<scriptPath>Jenkinsfile.groovy</scriptPath>
|
||||||
|
<lightweight>true</lightweight>
|
||||||
</definition>
|
</definition>
|
||||||
<actions/>
|
<actions/>
|
||||||
<description><!-- Managed by Jenkins Job Builder --></description>
|
<description><!-- Managed by Jenkins Job Builder --></description>
|
||||||
|
@ -8,4 +8,5 @@
|
|||||||
url: http://hg.example.org/test_job
|
url: http://hg.example.org/test_job
|
||||||
clean: true
|
clean: true
|
||||||
script-path: Jenkinsfile.groovy
|
script-path: Jenkinsfile.groovy
|
||||||
|
lightweight-checkout: true
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user