copyartifact: Add support for new options

New options include:
1. exclude
2. result-var-suffix

This update affects copyartifact in builders.py

Change-Id: I682a10be47f049fe457e5bc199aa50a5583958a7
Signed-off-by: Tan Heng Yeow <E0032242@u.nus.edu>
This commit is contained in:
tanhengyeow 2018-08-25 20:32:26 +08:00
parent de4fb862f3
commit a345b8372a
6 changed files with 18 additions and 1 deletions

View File

@ -167,7 +167,12 @@ def copyartifact(registry, xml_parent, data):
which-build
:arg string parameter-filters: Filter matching jobs based on these
parameters (optional)
:arg string exclude: Specify paths or patterns of artifacts to
exclude, even if specified in "Artifacts to copy". (default '')
:arg string result-var-suffix: The build number of the selected build
will be recorded into the variable named
COPYARTIFACT_BUILD_NUMBER_(SUFFIX)
for later build steps to reference. (default '')
Example:
@ -191,6 +196,8 @@ def copyartifact(registry, xml_parent, data):
('optional', 'optional', False),
('do-not-fingerprint', 'doNotFingerprintArtifacts', False),
('parameter-filters', 'parameters', ''),
('exclude', 'exclude', ''),
('result-var-suffix', 'resultVariableSuffix', ''),
]
helpers.convert_mapping_to_xml(t, data, mappings, fail_required=True)
helpers.copyartifact_build_selector(t, data)

View File

@ -9,6 +9,8 @@
<optional>true</optional>
<doNotFingerprintArtifacts>true</doNotFingerprintArtifacts>
<parameters>PUBLISH=true</parameters>
<exclude/>
<resultVariableSuffix/>
<selector class="hudson.plugins.copyartifact.SpecificBuildSelector">
<buildNumber>123</buildNumber>
</selector>

View File

@ -9,6 +9,8 @@
<optional>true</optional>
<doNotFingerprintArtifacts>false</doNotFingerprintArtifacts>
<parameters>PUBLISH=true</parameters>
<exclude/>
<resultVariableSuffix/>
<selector class="hudson.plugins.copyartifact.LastCompletedBuildSelector"/>
</hudson.plugins.copyartifact.CopyArtifact>
</builders>

View File

@ -9,6 +9,8 @@
<optional>true</optional>
<doNotFingerprintArtifacts>true</doNotFingerprintArtifacts>
<parameters>PUBLISH=true</parameters>
<exclude/>
<resultVariableSuffix/>
<selector class="hudson.plugins.copyartifact.DownstreamBuildSelector">
<upstreamProjectName>bar</upstreamProjectName>
<upstreamBuildNumber>123</upstreamBuildNumber>

View File

@ -9,6 +9,8 @@
<optional>true</optional>
<doNotFingerprintArtifacts>false</doNotFingerprintArtifacts>
<parameters>PUBLISH=true</parameters>
<exclude>*.txt</exclude>
<resultVariableSuffix>PROJECT_ABC</resultVariableSuffix>
<selector class="com.tikal.jenkins.plugins.multijob.MultiJobBuildSelector"/>
</hudson.plugins.copyartifact.CopyArtifact>
</builders>

View File

@ -7,3 +7,5 @@ builders:
optional: true
flatten: true
parameter-filters: PUBLISH=true
exclude: "*.txt"
result-var-suffix: "PROJECT_ABC"