Import specific job binaries; Add imported meta to this jobs meta

This commit is contained in:
Dan Hawkins 2018-12-03 14:47:13 +00:00
commit a5cd7e43ac
2 changed files with 9 additions and 16 deletions

View file

@ -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: [

View file

@ -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 <WORKSPACE>/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) {