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
|
||||
* **script-path**: path to the Groovy file containing the job's steps
|
||||
(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.
|
||||
|
||||
|
|
|
@ -1422,9 +1422,11 @@ class PipelineSCM(jenkins_jobs.modules.base.Base):
|
|||
raise JenkinsJobsException("'scm' missing or empty")
|
||||
elif scms_count == 1:
|
||||
self.registry.dispatch('scm', definition_parent, scms[0])
|
||||
XML.SubElement(definition_parent, 'scriptPath'
|
||||
).text = pipeline_dict.get('script-path',
|
||||
'Jenkinsfile')
|
||||
mapping = [('script-path', 'scriptPath', 'Jenkinsfile'),
|
||||
('lightweight-checkout', 'lightweight', None,
|
||||
[True, False])]
|
||||
convert_mapping_to_xml(definition_parent, pipeline_dict,
|
||||
mapping, fail_required=False)
|
||||
else:
|
||||
raise JenkinsJobsException('Only one SCM can be specified '
|
||||
'as pipeline-scm')
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
<disableChangeLog>false</disableChangeLog>
|
||||
</scm>
|
||||
<scriptPath>Jenkinsfile.groovy</scriptPath>
|
||||
<lightweight>true</lightweight>
|
||||
</definition>
|
||||
<actions/>
|
||||
<description><!-- Managed by Jenkins Job Builder --></description>
|
||||
|
|
|
@ -8,4 +8,5 @@
|
|||
url: http://hg.example.org/test_job
|
||||
clean: true
|
||||
script-path: Jenkinsfile.groovy
|
||||
lightweight-checkout: true
|
||||
|
||||
|
|
Loading…
Reference in New Issue