general: add support for childCustomWorkspace
On freestyle project, we can set custom workspace. On matrix project, we can set custom workspace and child custom workspace. It allows to specify the directory for sub-builds. Change-Id: Icef3831174ff805e86f1ece84fef9a438f465691 Signed-off-by: Fathi Boudra <fathi.boudra@linaro.org>
This commit is contained in:
parent
9e0ef50a18
commit
b72b10dd44
@ -56,6 +56,10 @@ Example:
|
||||
Path for a custom workspace. Defaults to Jenkins default
|
||||
configuration.
|
||||
|
||||
* **child-workspace**:
|
||||
Path for a child custom workspace. Defaults to Jenkins default
|
||||
configuration. This parameter is only valid for matrix type jobs.
|
||||
|
||||
* **quiet-period**:
|
||||
Number of seconds to wait between consecutive runs of this job.
|
||||
Defaults to ``0``.
|
||||
@ -139,6 +143,9 @@ class General(jenkins_jobs.modules.base.Base):
|
||||
if 'workspace' in data:
|
||||
XML.SubElement(xml, 'customWorkspace').text = \
|
||||
str(data['workspace'])
|
||||
if (xml.tag == 'matrix-project') and ('child-workspace' in data):
|
||||
XML.SubElement(xml, 'childCustomWorkspace').text = \
|
||||
str(data['child-workspace'])
|
||||
if 'quiet-period' in data:
|
||||
XML.SubElement(xml, 'quietPeriod').text = str(data['quiet-period'])
|
||||
node = data.get('node', None)
|
||||
|
10
tests/general/fixtures/custom-workspace001.xml
Normal file
10
tests/general/fixtures/custom-workspace001.xml
Normal file
@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<project>
|
||||
<actions/>
|
||||
<keepDependencies>false</keepDependencies>
|
||||
<blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
|
||||
<blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
|
||||
<concurrentBuild>false</concurrentBuild>
|
||||
<customWorkspace>foo</customWorkspace>
|
||||
<canRoam>true</canRoam>
|
||||
</project>
|
3
tests/general/fixtures/custom-workspace001.yaml
Normal file
3
tests/general/fixtures/custom-workspace001.yaml
Normal file
@ -0,0 +1,3 @@
|
||||
project-type: freestyle
|
||||
workspace: foo
|
||||
child-workspace: bar
|
16
tests/general/fixtures/custom-workspace002.xml
Normal file
16
tests/general/fixtures/custom-workspace002.xml
Normal file
@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<matrix-project>
|
||||
<executionStrategy class="hudson.matrix.DefaultMatrixExecutionStrategyImpl">
|
||||
<runSequentially>false</runSequentially>
|
||||
</executionStrategy>
|
||||
<combinationFilter/>
|
||||
<axes/>
|
||||
<actions/>
|
||||
<keepDependencies>false</keepDependencies>
|
||||
<blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
|
||||
<blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
|
||||
<concurrentBuild>false</concurrentBuild>
|
||||
<customWorkspace>foo</customWorkspace>
|
||||
<childCustomWorkspace>bar</childCustomWorkspace>
|
||||
<canRoam>true</canRoam>
|
||||
</matrix-project>
|
3
tests/general/fixtures/custom-workspace002.yaml
Normal file
3
tests/general/fixtures/custom-workspace002.yaml
Normal file
@ -0,0 +1,3 @@
|
||||
project-type: matrix
|
||||
workspace: foo
|
||||
child-workspace: bar
|
Loading…
Reference in New Issue
Block a user