From a5cd7e43acf791622620f270e12decfe2953ff3f Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Mon, 3 Dec 2018 14:47:13 +0000 Subject: [PATCH] Import specific job binaries; Add imported meta to this jobs meta --- import/importer.groovy | 6 ++++-- install/installhelper.groovy | 19 +++++-------------- 2 files changed, 9 insertions(+), 16 deletions(-) diff --git a/import/importer.groovy b/import/importer.groovy index 4d24d30..bf040ce 100644 --- a/import/importer.groovy +++ b/import/importer.groovy @@ -1,7 +1,8 @@ -def artifactimport(meta, String jenkinsjob, int buildnumber, String destpath, String filter = '**', boolean fingerprint = false) { +def artifactimport(meta, String jenkinsjob, int buildnumber, String destpath, String filter = '**', String excludes = '', boolean fingerprint = false) { copyArtifacts( filter: filter, + excludes: excludes, fingerprintArtifacts: fingerprint, projectName: jenkinsjob.trim(), selector: specific(buildnumber.toString()), @@ -10,9 +11,10 @@ def artifactimport(meta, String jenkinsjob, int buildnumber, String destpath, St return meta.importrelated(destpath) } -def artifactimport(meta, String jenkinsjob, String buildselector, String destpath, String filter = '**', boolean fingerprint = false) { +def artifactimport(meta, String jenkinsjob, String buildselector, String destpath, String filter = '**', String excludes = '', boolean fingerprint = false) { copyArtifacts( filter: filter, + excludes: excludes, fingerprintArtifacts: fingerprint, projectName: jenkinsjob.trim(), selector: [ diff --git a/install/installhelper.groovy b/install/installhelper.groovy index f523799..fdd6016 100644 --- a/install/installhelper.groovy +++ b/install/installhelper.groovy @@ -1,30 +1,21 @@ // Given details about artifacts to import and details of installers to build, import artifacts that are required -def artifactsImporter(artifactDetails, installerDetails) { +def artifactsImporter(meta, artifactDetails, installerDetails) { artifactFetched = [:] + def importer = load("${autobuilder.commonscripts()}/import/importer.groovy") for (installer in toBuild) { def artifactKey = installerDetails.get(installer)[0] - //echo "To build: ${installer} use artifactKey: ${artifactKey}" - (sourceProject, destFolder, toCopy, notToCopy, binariesFolders) = artifactDetails.get(artifactKey) + (sourceProject, sourceselector, destFolder, toCopy, notToCopy, binariesFolders) = artifactDetails.get(artifactKey) env.importDest = destFolder if (artifactFetched.get(artifactKey) == null) { - //echo "Artifact info: ${artifactInfo}" - copyArtifacts excludes: notToCopy, filter: toCopy, fingerprintArtifacts: true, projectName: "${sourceProject}", selector: lastSuccessful(), target: "${destFolder}" - def componentVersionFolder = "${WORKSPACE}\\version\\version_${artifactKey}" - def folderToCopy = "${destFolder}\\version" - echo "Copying from: ${folderToCopy} to: ${componentVersionFolder}" - fileOperations([folderCopyOperation(destinationFolderPath: componentVersionFolder, sourceFolderPath: folderToCopy)]) - //fileOperations([fileCopyOperation(excludes: '', flattenFiles: false, includes: filesToCopy, targetLocation: componentVersionFolder )]) - def gh = load("${autobuilder.commonscripts()}/versioncontrol/git.groovy") - artifactVersion = gh.getSHAFromVersion("${destFolder}/version") - artifactFetched.put(artifactKey, artifactVersion) + def importmeta = importer.artifactimport(meta, sourceProject, sourceselector, destpath, toCopy, notToCopy, true) } } return artifactFetched } // Export any required binaries to the /bin folder -def exportBinaries(artifactDetails, installerDetails) { +def placeBinaries(artifactDetails, installerDetails) { for (installer in toBuild) { (artifactSet, targetFolder, executionPath, ISMprojectFile, installerVariant, exportBinaries) = installerDetails.get(installer) if (exportBinaries) {