From 1e29bd5e2f6bd141d6c4ac0718c7440cd679d24f Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sat, 29 Jan 2022 15:58:36 +0000 Subject: [PATCH 1/7] Force item copier workspace to be cleaned each time --- copy/all.groovy | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/copy/all.groovy b/copy/all.groovy index aab479c..d0a7fb3 100644 --- a/copy/all.groovy +++ b/copy/all.groovy @@ -4,27 +4,18 @@ pipeline { stage('Initial setup') { steps { script { + // Force workspace to be cleaned + CLEAN_WORKSPACE = "true" meta = load("${WORKSPACE}/autobuild/Common_scripts/autobuilder.groovy").startnonbuild(this) importer = load("${autobuilder.commonscripts()}/import/importer.groovy") } } } - stage('Clean exports') { - steps { - script { - IMPORTS = 'imports' - cleanfolders = [ - IMPORTS, - ] - cleaner = load("${autobuilder.commonscripts()}/clean/clean.groovy") - cleaner.clean(cleanfolders) - } - } - } stage('Import source artifacts') { steps { script { + IMPORTS = 'imports' def copyoptions = importer.getNewImportOptions() copyoptions.source( SOURCE_ARTIFACT_LOCATION, From 10d0019fd44ae1bb149ca3c7760a1dfd66459656 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sat, 29 Jan 2022 16:13:21 +0000 Subject: [PATCH 2/7] Ensure script objects are around when source files have been cleaned --- copy/all.groovy | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/copy/all.groovy b/copy/all.groovy index d0a7fb3..ea56044 100644 --- a/copy/all.groovy +++ b/copy/all.groovy @@ -32,9 +32,9 @@ pipeline { stage('Archiving artifacts') { steps { script { - def artifactlist = meta.generateartifacts(['**/*']) def artifactarchiver = load("${autobuilder.commonscripts()}/artifacts/archiver.groovy") + def cleaner = load("${autobuilder.commonscripts()}/clean/clean.groovy") cleaner.clean(['meta', 'autobuild']) dir(IMPORTS) { @@ -48,6 +48,7 @@ pipeline { cleaner.clean([IMPORTS]) + def artifactlist = meta.generateartifacts(['**/*']) artifactarchiver.archive(meta, artifactlist) } } From 2e74e8aa8a46d71f74ee1c660fc1e3de5251d0ea Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sat, 29 Jan 2022 23:14:04 +0000 Subject: [PATCH 3/7] Eliminate a copy for performance --- copy/all.groovy | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/copy/all.groovy b/copy/all.groovy index ea56044..5bf9590 100644 --- a/copy/all.groovy +++ b/copy/all.groovy @@ -15,7 +15,6 @@ pipeline { stage('Import source artifacts') { steps { script { - IMPORTS = 'imports' def copyoptions = importer.getNewImportOptions() copyoptions.source( SOURCE_ARTIFACT_LOCATION, @@ -25,7 +24,7 @@ pipeline { SOURCE_ARTIFACT_RELEASE_REVISION) echo "Nested: ${NESTED_COPY}" copyoptions.setnested(NESTED_COPY == 'true') - importer.artifactimport(meta, copyoptions, IMPORTS) + importer.artifactimport(meta, copyoptions, WORKSPACE) } } } @@ -37,17 +36,6 @@ pipeline { def cleaner = load("${autobuilder.commonscripts()}/clean/clean.groovy") cleaner.clean(['meta', 'autobuild']) - dir(IMPORTS) { - fileOperations([ - fileCopyOperation(excludes: '', - flattenFiles: false, - includes: '**/*', - targetLocation: WORKSPACE) - ]) - } - - cleaner.clean([IMPORTS]) - def artifactlist = meta.generateartifacts(['**/*']) artifactarchiver.archive(meta, artifactlist) } From 4044992fbb8e1976084428be2f19e576205d5080 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sat, 29 Jan 2022 23:19:04 +0000 Subject: [PATCH 4/7] Eliminate a copy for performance --- copy/all.groovy | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/copy/all.groovy b/copy/all.groovy index 5bf9590..2a88800 100644 --- a/copy/all.groovy +++ b/copy/all.groovy @@ -9,6 +9,8 @@ pipeline { meta = load("${WORKSPACE}/autobuild/Common_scripts/autobuilder.groovy").startnonbuild(this) importer = load("${autobuilder.commonscripts()}/import/importer.groovy") + cleaner = load("${autobuilder.commonscripts()}/clean/clean.groovy") + artifactarchiver = load("${autobuilder.commonscripts()}/artifacts/archiver.groovy") } } } @@ -31,9 +33,6 @@ pipeline { stage('Archiving artifacts') { steps { script { - def artifactarchiver = load("${autobuilder.commonscripts()}/artifacts/archiver.groovy") - - def cleaner = load("${autobuilder.commonscripts()}/clean/clean.groovy") cleaner.clean(['meta', 'autobuild']) def artifactlist = meta.generateartifacts(['**/*']) From 3271d90a49d6773f744575293653b4fe7ebba5cc Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sat, 29 Jan 2022 23:24:13 +0000 Subject: [PATCH 5/7] Eliminate a copy for performance --- copy/all.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/copy/all.groovy b/copy/all.groovy index 2a88800..a6431da 100644 --- a/copy/all.groovy +++ b/copy/all.groovy @@ -26,7 +26,7 @@ pipeline { SOURCE_ARTIFACT_RELEASE_REVISION) echo "Nested: ${NESTED_COPY}" copyoptions.setnested(NESTED_COPY == 'true') - importer.artifactimport(meta, copyoptions, WORKSPACE) + importer.artifactimport(meta, copyoptions, "${WORKSPACE}/.") } } } From cbc328915d31d7cfbe0d5e45ae4792b1193d5039 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sat, 29 Jan 2022 23:48:45 +0000 Subject: [PATCH 6/7] Eliminate a copy for performance --- copy/all.groovy | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/copy/all.groovy b/copy/all.groovy index a6431da..14c0b35 100644 --- a/copy/all.groovy +++ b/copy/all.groovy @@ -33,9 +33,19 @@ pipeline { stage('Archiving artifacts') { steps { script { - cleaner.clean(['meta', 'autobuild']) + // Save the imported meta - while the unwanted meta is written to file then deleted + def stashname = 'Imported meta stash' + stash(allowEmpty: true, + includes: 'meta/**', + name: stashname, + useDefaultExcludes: false) + { + def artifactlist = meta.generateartifacts(['**/*']) + + cleaner.clean(['meta', 'autobuild']) + } + unstash(name: stashname) - def artifactlist = meta.generateartifacts(['**/*']) artifactarchiver.archive(meta, artifactlist) } } From 0326879391035840f42f5e1eb5ffc92e834c8995 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sun, 30 Jan 2022 00:04:18 +0000 Subject: [PATCH 7/7] Eliminate a copy for performance --- copy/all.groovy | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/copy/all.groovy b/copy/all.groovy index 14c0b35..24aacfb 100644 --- a/copy/all.groovy +++ b/copy/all.groovy @@ -39,11 +39,10 @@ pipeline { includes: 'meta/**', name: stashname, useDefaultExcludes: false) - { - def artifactlist = meta.generateartifacts(['**/*']) - cleaner.clean(['meta', 'autobuild']) - } + def artifactlist = meta.generateartifacts(['**/*']) + cleaner.clean(['meta', 'autobuild']) + unstash(name: stashname) artifactarchiver.archive(meta, artifactlist)