Squashed 'Common_scripts/' changes from 2ab8282..0326879

0326879 Eliminate a copy for performance
cbc3289 Eliminate a copy for performance
3271d90 Eliminate a copy for performance
4044992 Eliminate a copy for performance
2e74e8a Eliminate a copy for performance
10d0019 Ensure script objects are around when source files have been cleaned
1e29bd5 Force item copier workspace to be cleaned each time
5575f2b Don't attempt to import artifacts associated with components that do not have complete meta
9b89c0f CORE-348 - Reverse a debugging change
3db76ce Merge remote-tracking branch 'origin/master' into CORE-348
2a17eb0 Merge commit 'ad8723e7c8df7b9ffceec3540fd88e9f847e7a7f' into production
b9f5240 / missing when doing hierarchical release repo checkout
e67bec1 When doing nested release repo imports - ignore components that have incomplete release info
16d7c9c Merge remote-tracking branch 'origin/master' into CORE-348
56951ba CORE-348: Trying to resolve a git error in the autobuild.

git-subtree-dir: Common_scripts
git-subtree-split: 0326879391
This commit is contained in:
Dan Hawkins 2022-02-01 14:55:48 +00:00
commit d1a56a994c
2 changed files with 23 additions and 33 deletions

View file

@ -4,21 +4,13 @@ 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)
artifactarchiver = load("${autobuilder.commonscripts()}/artifacts/archiver.groovy")
}
}
}
@ -34,29 +26,25 @@ pipeline {
SOURCE_ARTIFACT_RELEASE_REVISION)
echo "Nested: ${NESTED_COPY}"
copyoptions.setnested(NESTED_COPY == 'true')
importer.artifactimport(meta, copyoptions, IMPORTS)
importer.artifactimport(meta, copyoptions, "${WORKSPACE}/.")
}
}
}
stage('Archiving artifacts') {
steps {
script {
def artifactlist = meta.generateartifacts(['**/*'])
def artifactarchiver = load("${autobuilder.commonscripts()}/artifacts/archiver.groovy")
// 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'])
dir(IMPORTS) {
fileOperations([
fileCopyOperation(excludes: '',
flattenFiles: false,
includes: '**/*',
targetLocation: WORKSPACE)
])
}
unstash(name: stashname)
cleaner.clean([IMPORTS])
artifactarchiver.archive(meta, artifactlist)
}
}

View file

@ -239,15 +239,17 @@ def hierarchyartifactimportfromrepo(meta, ImportOptions importoptions, String de
def cloneurl = relatedmeta.releaseinfo.releaserepoURL
def clonerevision = "refs/tags/${relatedmeta.releasetag()}"
def clonepath = "${destpath}/${relatedoffsetpath}"
echo "Cloning release repo: ${cloneurl}, revision: ${clonerevision} at folder: ${clonepath}"
gh.gitCheckoutAlt(cloneurl, clonerevision, clonepath, "", 1, true, [])
gh.stripgithistory(clonepath)
def metafilepath = "${clonepath}${relatedmeta.metafilepath()}"
echo "Marking related meta as released and rewriting meta file: ${metafilepath}"
rewritemetafileasreleased(relatedmeta, metafilepath)
if (relatedmeta.componentidentifier() != '_' &&
cloneurl != '') {
echo "Cloning release repo: ${cloneurl}, revision: ${clonerevision} at folder: ${clonepath}"
gh.gitCheckoutAlt(cloneurl, clonerevision, clonepath, "", 1, true, [])
gh.stripgithistory(clonepath)
def metafilepath = "${clonepath}/${relatedmeta.metafilepath()}"
echo "Marking related meta as released and rewriting meta file: ${metafilepath}"
rewritemetafileasreleased(relatedmeta, metafilepath)
} else {
echo "Not importing component that would be placed at path: ${clonepath}"
}
}
gh.stripgithistory(destpath)
def metafilepath = "${destpath}/${meta.metafilepath()}"