From 2393df8cb20b15b5a60ed6a6989263189df86005 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Wed, 24 Oct 2018 13:32:04 +0100 Subject: [PATCH 1/2] Move meta artifact builder to common scripts subtree area --- artifacts/metaexport.gsh | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 artifacts/metaexport.gsh diff --git a/artifacts/metaexport.gsh b/artifacts/metaexport.gsh new file mode 100644 index 0000000..368871e --- /dev/null +++ b/artifacts/metaexport.gsh @@ -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; From 18c1343663e761a9733f739c2bb6de4b3c783eea Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Wed, 24 Oct 2018 14:24:17 +0100 Subject: [PATCH 2/2] Move meta artifact builder to common scripts subtree area --- artifacts/metaexport.gsh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/artifacts/metaexport.gsh b/artifacts/metaexport.gsh index 368871e..66a8153 100644 --- a/artifacts/metaexport.gsh +++ b/artifacts/metaexport.gsh @@ -1,6 +1,6 @@ // 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}") { +def combineSubjobArtifacts(subJobs) { artifactFolders = "" for (subJob in subJobs) { subJobObject = subJob[0] @@ -8,7 +8,7 @@ def combineSubjobArtifacts(subJobs, artifactFolders, exportRootFolder = "${WORKS if (subJobObject != null) { subJobName = subJobObject.getProjectName() subJobNumber = subJobObject.getNumber() - destFolder = "${exportRootFolder}/${artifactFolder}" + destFolder = "${artifactFolder}" dir("${destFolder}") { deleteDir() @@ -19,6 +19,7 @@ def combineSubjobArtifacts(subJobs, artifactFolders, exportRootFolder = "${WORKS artifactFolders += "${destFolder}/**," } } + return artifactFolders; } return this;