Move meta artifact builder to common scripts subtree area
This commit is contained in:
parent
74fb5ffa2a
commit
2dfbe7b4c3
1 changed files with 24 additions and 0 deletions
24
artifacts/metaexport.gsh
Normal file
24
artifacts/metaexport.gsh
Normal file
|
|
@ -0,0 +1,24 @@
|
||||||
|
|
||||||
|
// Take a list of Sub-job descriptors and output folder pairs, copy the artifacts, while filling in a string of artifact folders
|
||||||
|
def combineSubjobArtifacts(subJobs, artifactFolders, exportRootFolder = "${WORKSPACE}") {
|
||||||
|
artifactFolders = ""
|
||||||
|
for (subJob in subJobs) {
|
||||||
|
subJobObject = subJob[0]
|
||||||
|
artifactFolder = subJob[1]
|
||||||
|
if (subJobObject != null) {
|
||||||
|
subJobName = subJobObject.getProjectName()
|
||||||
|
subJobNumber = subJobObject.getNumber()
|
||||||
|
destFolder = "${exportRootFolder}/${artifactFolder}"
|
||||||
|
|
||||||
|
dir("${destFolder}") {
|
||||||
|
deleteDir()
|
||||||
|
}
|
||||||
|
|
||||||
|
echo "Copying artifacts from: Job: ${subJobName} Number: ${subJobNumber} to folder: ${destFolder}"
|
||||||
|
copyArtifacts fingerprintArtifacts: true, projectName: "${subJobName}", selector: specific("${subJobNumber}"), target: "${destFolder}"
|
||||||
|
artifactFolders += "${destFolder}/**,"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return this;
|
||||||
Loading…
Add table
Add a link
Reference in a new issue