From 94ba8c77a4319a7e5c226ffc13968d70255d8d0d Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 30 Nov 2021 21:20:31 +0000 Subject: [PATCH 001/182] Provide specific parameter names appropriate to type of post build job being called --- build/postactions.groovy | 29 +++++++++-------------------- 1 file changed, 9 insertions(+), 20 deletions(-) diff --git a/build/postactions.groovy b/build/postactions.groovy index 06ad8ad..2a0b0fd 100644 --- a/build/postactions.groovy +++ b/build/postactions.groovy @@ -85,26 +85,15 @@ def getActionJobName(postbuildactions, String action, String alternativeparamnam return jobname } -def deployjob(String buildselector, postbuildactions, String action, String alternativeparamname) { +def deployjob(String buildselector, postbuildactions, String action, String alternativeparamname, String jobnameparametername, String jobselectorparametername) { def jobname = getActionJobName(postbuildactions, action, alternativeparamname) if (jobname) { build( wait: false, job: jobname, parameters: [ - // For most jobs - string(name: 'APPLICATION_ARTIFACT_PROJECT', value: JOB_NAME), - string(name: 'APPLICATION_ARTIFACT_SELECTOR', value: buildselector), - // For doxygen jobs - string(name: 'BUILD_JOB_WITH_DOXYGEN_ARTIFACTS', value: JOB_NAME), - string(name: 'BUILD_JOB_WITH_DOXYGEN_ARTIFACTS_SELECTOR', value: buildselector), - // For diff jobs - string(name: 'LATER_SOURCE', value: 'Jenkins job artifact'), - string(name: 'LATER_BUILD_JOB', value: JOB_NAME), - string(name: 'LATER_BUILD_SELECTOR', value: buildselector), - // For regression jobs - string(name: 'BUILD_JOB', value: JOB_NAME), - string(name: 'BUILD_JOB_SELECTOR', value: buildselector), + string(name: jobnameparametername, value: JOB_NAME), + string(name: jobselectorparametername, value: buildselector), ] ) } @@ -130,12 +119,12 @@ def performSuccessfulBuildActions() { } } def String buildselector = "${BUILD_NUMBER}" - deployjob(buildselector, postbuildactions, 'Deploy documentation', 'DOXYGEN_DEPLOY_JOB') - deployjob(buildselector, postbuildactions, 'Static analysis', 'STATIC_ANALYSIS_JOB') - deployjob(buildselector, postbuildactions, 'Unit test', 'UNIT_TEST_JOB') - deployjob(buildselector, postbuildactions, 'Regression test', 'REGRESSION_TEST_JOB') - deployjob(buildselector, postbuildactions, 'Update differences', 'DIFF_JOB') - deployjob(buildselector, postbuildactions, 'Release to git', 'RELEASE_TO_GIT_JOB') + deployjob(buildselector, postbuildactions, 'Deploy documentation', 'DOXYGEN_DEPLOY_JOB', 'BUILD_JOB_WITH_DOXYGEN_ARTIFACTS', 'BUILD_JOB_WITH_DOXYGEN_ARTIFACTS_SELECTOR') + deployjob(buildselector, postbuildactions, 'Static analysis', 'STATIC_ANALYSIS_JOB', 'BUILD_JOB_TO_ANALYSE', 'BUILD_JOB_TO_ANALYSE_SELECTOR' ) + deployjob(buildselector, postbuildactions, 'Unit test', 'UNIT_TEST_JOB', 'BUILD_JOB_TO_TEST', 'BUILD_JOB_TEST_SELECTOR') + deployjob(buildselector, postbuildactions, 'Regression test', 'REGRESSION_TEST_JOB', 'BUILD_JOB_TO_TEST', 'BUILD_JOB_TEST_SELECTOR') + deployjob(buildselector, postbuildactions, 'Update differences', 'DIFF_JOB', 'LATER_BUILD_JOB', 'LATER_BUILD_SELECTOR') + deployjob(buildselector, postbuildactions, 'Release to git', 'RELEASE_TO_GIT_JOB', 'BUILD_JOB', 'BUILD_JOB_SELECTOR') } def sendemails(emailinfo) { From a1340ea0eb50d5515a52ddc380258c1073b05c76 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 30 Nov 2021 21:23:58 +0000 Subject: [PATCH 002/182] Provide specific parameter names appropriate to type of post build job being called --- build/postactions.groovy | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build/postactions.groovy b/build/postactions.groovy index 2a0b0fd..8b18908 100644 --- a/build/postactions.groovy +++ b/build/postactions.groovy @@ -121,8 +121,8 @@ def performSuccessfulBuildActions() { def String buildselector = "${BUILD_NUMBER}" deployjob(buildselector, postbuildactions, 'Deploy documentation', 'DOXYGEN_DEPLOY_JOB', 'BUILD_JOB_WITH_DOXYGEN_ARTIFACTS', 'BUILD_JOB_WITH_DOXYGEN_ARTIFACTS_SELECTOR') deployjob(buildselector, postbuildactions, 'Static analysis', 'STATIC_ANALYSIS_JOB', 'BUILD_JOB_TO_ANALYSE', 'BUILD_JOB_TO_ANALYSE_SELECTOR' ) - deployjob(buildselector, postbuildactions, 'Unit test', 'UNIT_TEST_JOB', 'BUILD_JOB_TO_TEST', 'BUILD_JOB_TEST_SELECTOR') - deployjob(buildselector, postbuildactions, 'Regression test', 'REGRESSION_TEST_JOB', 'BUILD_JOB_TO_TEST', 'BUILD_JOB_TEST_SELECTOR') + deployjob(buildselector, postbuildactions, 'Unit test', 'UNIT_TEST_JOB', 'BUILD_JOB_TO_TEST', 'BUILD_JOB_TO_TEST_SELECTOR') + deployjob(buildselector, postbuildactions, 'Regression test', 'REGRESSION_TEST_JOB', 'BUILD_JOB_TO_TEST', 'BUILD_JOB_TO_TEST_SELECTOR') deployjob(buildselector, postbuildactions, 'Update differences', 'DIFF_JOB', 'LATER_BUILD_JOB', 'LATER_BUILD_SELECTOR') deployjob(buildselector, postbuildactions, 'Release to git', 'RELEASE_TO_GIT_JOB', 'BUILD_JOB', 'BUILD_JOB_SELECTOR') } From 793c9798e82175e460ca52db6c33aa0cb67280be Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Wed, 1 Dec 2021 16:22:50 +0000 Subject: [PATCH 003/182] Remove ACM from Vertical stack (as it is using different versions of Atlas); Import the MCS version that was used to build Atlas UI --- import/importer.groovy | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/import/importer.groovy b/import/importer.groovy index 2562693..d40c52f 100644 --- a/import/importer.groovy +++ b/import/importer.groovy @@ -341,4 +341,25 @@ def artifactimport(meta, return artifactimport(meta, importoptions, destpath) } +// Import the artifacts of a named child component found below parent meta's hierarchy +def artifactimport(meta, parentmeta, String childproduct, String childsubcomponent, importoptions, String destinationfolder) { + // Import from parent meta + def childmeta = meta.getNewMetaObject() + def childmeta2 + echo "Finding meta associated with child: Product: ${childproduct} Sub-component: ${childsubcomponent}" + def findresults = parentmeta.findAssociatedMeta(childproduct, childsubcomponent) + if (findresults.matchfound) { + childmeta = findresults.matchedmeta + if (childmeta.releaseinfo.released) { + importoptions.releaserepo(childmeta.releaseinfo.releaserepoURL, childmeta.releasetag()) + } else { + importoptions.jenkinsjob(childmeta.jenkinsbuildinfo.buildjobname, childmeta.jenkinsbuildinfo.buildnumber) + } + childmeta2 = importer.artifactimport(meta, importoptions, destinationfolder) + } else { + error("Could not find meta associated with child: Product: ${childproduct} Sub-component: ${childsubcomponent}" + } + return childmeta2 +} + return this; From 815a9e9d88098f530fb2a7db4cd67530be0cf17e Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Wed, 1 Dec 2021 16:36:29 +0000 Subject: [PATCH 004/182] Remove ACM from Vertical stack (as it is using different versions of Atlas); Import the MCS version that was used to build Atlas UI --- import/importer.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/import/importer.groovy b/import/importer.groovy index d40c52f..0e2ca17 100644 --- a/import/importer.groovy +++ b/import/importer.groovy @@ -357,7 +357,7 @@ def artifactimport(meta, parentmeta, String childproduct, String childsubcompone } childmeta2 = importer.artifactimport(meta, importoptions, destinationfolder) } else { - error("Could not find meta associated with child: Product: ${childproduct} Sub-component: ${childsubcomponent}" + error("Could not find meta associated with child: Product: ${childproduct} Sub-component: ${childsubcomponent}") } return childmeta2 } From f7cc2163c965a0691a2e6df66578adbbd11f2e03 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Thu, 2 Dec 2021 14:46:22 +0000 Subject: [PATCH 005/182] Pass the parent build stamp to child jobs; Use the same Atlas services source code commit in all child jobs --- configuration/configuration.groovy | 4 ++-- meta/folder.groovy | 7 +++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/configuration/configuration.groovy b/configuration/configuration.groovy index 2a7f1ab..7a89975 100644 --- a/configuration/configuration.groovy +++ b/configuration/configuration.groovy @@ -1,7 +1,7 @@ gh = load("${autobuilder.commonscripts()}/versioncontrol/git.groovy") def registerConfigurationInfo(meta, String configurationName, String configurationURL, String configurationVersion, String configurationSHA) { - meta.addConfigurationInfo(configurationName, configurationURL, configurationVersion, configurationSHA) + return meta.addConfigurationInfo(configurationName, configurationURL, configurationVersion, configurationSHA) } def registerPipelineScriptConfiguration(meta) { @@ -12,7 +12,7 @@ def gitCheckoutAndRegister(meta, String tool, String gitURL, String revision, St def ArrayList sparseitemlist = gh.convertSparseItemsString(filter) gh.gitCheckoutAlt(gitURL, revision, targetDir, repoRoot, cloneDepth, shallowClone) - registerConfigurationInfo(meta, tool, gitURL, revision, gh.getGitInfo(targetDir)) + return registerConfigurationInfo(meta, tool, gitURL, revision, gh.getGitInfo(targetDir)) } return this diff --git a/meta/folder.groovy b/meta/folder.groovy index 694a40c..e144897 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -293,6 +293,12 @@ class BuildStampInfo extends GISJsonSerialised { set(other.buildstampprefix, other.revision, other.buildstamp) } + // Override the buildstamp + void override(String buildstamp) { + this.buildstamp = buildstamp + script.echo("Build stamp overridden to: ${this.buildstamp}") + } + String buildstampcommasep() { def String buildstampcommasep = buildstamp.replace(".", ",") return buildstampcommasep @@ -631,6 +637,7 @@ class MetaInfo extends GISJsonSerialised { def ConfigurationInfo ci = new ConfigurationInfo(script, configurationname, configurationURL, configurationversion, configurationSHA) script.echo("Adding configuration info: name: ${configurationname} url: ${configurationURL} version: ${configurationversion} sha: ${configurationSHA}") configurationinfo.add(ci) + return configurationinfo } void addCustomInfo(String customId, String customValue) { From 76b05afd70c94b2be4718118ad4962e77c580c77 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Thu, 2 Dec 2021 15:04:00 +0000 Subject: [PATCH 006/182] Pass the parent build stamp to child jobs; Use the same Atlas services source code commit in all child jobs --- meta/folder.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta/folder.groovy b/meta/folder.groovy index e144897..3217fd9 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -637,7 +637,7 @@ class MetaInfo extends GISJsonSerialised { def ConfigurationInfo ci = new ConfigurationInfo(script, configurationname, configurationURL, configurationversion, configurationSHA) script.echo("Adding configuration info: name: ${configurationname} url: ${configurationURL} version: ${configurationversion} sha: ${configurationSHA}") configurationinfo.add(ci) - return configurationinfo + return ci } void addCustomInfo(String customId, String customValue) { From d261eb27d51b937a599b9d0661f93146f7e05d2e Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Thu, 2 Dec 2021 22:20:47 +0000 Subject: [PATCH 007/182] Handle pre-generated buildnumber --- versionnumbering/generate.groovy | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/versionnumbering/generate.groovy b/versionnumbering/generate.groovy index 6e0db11..c3e1837 100644 --- a/versionnumbering/generate.groovy +++ b/versionnumbering/generate.groovy @@ -154,6 +154,22 @@ String generate(meta, String sourcerevision, String sourcepath, int basebuildnum return buildstamp } +String pregenerated(meta, String sourcerevision, String sourcepath, String pregeneratedbuildstamp, int basebuildnumber = 1000) { + def int gitrevisioncount + def String gitrevision + def String remoteinfo + def String remoteurl + + (gitrevisioncount, gitrevision, remoteinfo, remoteurl) = getGitRevision(sourcepath, basebuildnumber) + + echo "Build stamp is: ${pregeneratedbuildstamp}" + + meta.gitinfo.set(sourcepath, sourcerevision, gitrevision, remoteurl, remoteinfo) + meta.buildstampinfo.override(pregeneratedbuildstamp) + + return pregeneratedbuildstamp +} + String generate(meta, String sourcerevision, String sourcepath, String basebuildnumber) { def int bbn = basebuildnumber.trim().toInteger() return generate(meta, sourcerevision, sourcepath, bbn) From 9246812fbfa9185db78e1b67b8aa3ee0b9fdb84f Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Thu, 2 Dec 2021 22:27:44 +0000 Subject: [PATCH 008/182] Handle pre-generated buildnumber --- versionnumbering/generate.groovy | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/versionnumbering/generate.groovy b/versionnumbering/generate.groovy index c3e1837..7b435c4 100644 --- a/versionnumbering/generate.groovy +++ b/versionnumbering/generate.groovy @@ -155,16 +155,7 @@ String generate(meta, String sourcerevision, String sourcepath, int basebuildnum } String pregenerated(meta, String sourcerevision, String sourcepath, String pregeneratedbuildstamp, int basebuildnumber = 1000) { - def int gitrevisioncount - def String gitrevision - def String remoteinfo - def String remoteurl - - (gitrevisioncount, gitrevision, remoteinfo, remoteurl) = getGitRevision(sourcepath, basebuildnumber) - - echo "Build stamp is: ${pregeneratedbuildstamp}" - - meta.gitinfo.set(sourcepath, sourcerevision, gitrevision, remoteurl, remoteinfo) + generate(meta, sourcerevision, sourcepath, basebuildnumber) meta.buildstampinfo.override(pregeneratedbuildstamp) return pregeneratedbuildstamp From 7b1eb1142ff32ebf9cd54c3c636cf133d033ab2d Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Thu, 2 Dec 2021 23:16:35 +0000 Subject: [PATCH 009/182] Handle pre-generated buildnumber --- meta/folder.groovy | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/meta/folder.groovy b/meta/folder.groovy index 3217fd9..7a8c020 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -295,6 +295,12 @@ class BuildStampInfo extends GISJsonSerialised { // Override the buildstamp void override(String buildstamp) { + def s = buildstamp.split('\\.') + if (s.size() != 4) { + script.error("Overriding build stamp: ${buildstamp} is not of the format: 1.2.3.4") + } + this.stampprefix = "${s[0]}.${s[1]}.${s[2]}" + this.revision = "${s[3]}".toInteger() this.buildstamp = buildstamp script.echo("Build stamp overridden to: ${this.buildstamp}") } From 79d92bf4820e420941c181ab6f10ec1a0edd7a5f Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Fri, 3 Dec 2021 10:04:46 +0000 Subject: [PATCH 010/182] Handle pre-generated buildnumber --- meta/folder.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta/folder.groovy b/meta/folder.groovy index 7a8c020..c5a5309 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -300,7 +300,7 @@ class BuildStampInfo extends GISJsonSerialised { script.error("Overriding build stamp: ${buildstamp} is not of the format: 1.2.3.4") } this.stampprefix = "${s[0]}.${s[1]}.${s[2]}" - this.revision = "${s[3]}".toInteger() + this.revision = s[3].toInteger() this.buildstamp = buildstamp script.echo("Build stamp overridden to: ${this.buildstamp}") } From 603e13cb818ff91a271a2028981d33bd9889b463 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Fri, 3 Dec 2021 10:12:01 +0000 Subject: [PATCH 011/182] Handle pre-generated buildnumber --- meta/folder.groovy | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/meta/folder.groovy b/meta/folder.groovy index c5a5309..9951485 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -295,14 +295,16 @@ class BuildStampInfo extends GISJsonSerialised { // Override the buildstamp void override(String buildstamp) { - def s = buildstamp.split('\\.') + this.buildstamp = buildstamp + script.echo("Build stamp overridden to: ${this.buildstamp}") + def s = this.buildstamp.split('\\.') if (s.size() != 4) { script.error("Overriding build stamp: ${buildstamp} is not of the format: 1.2.3.4") } this.stampprefix = "${s[0]}.${s[1]}.${s[2]}" + script.echo("Stamp prefix overridden to: ${this.stampprefix}") this.revision = s[3].toInteger() - this.buildstamp = buildstamp - script.echo("Build stamp overridden to: ${this.buildstamp}") + script.echo("Revision overridden to: ${this.revision}") } String buildstampcommasep() { From 710557d84c46b5c3f858beeae6eb76531fcf00bd Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Fri, 3 Dec 2021 11:02:34 +0000 Subject: [PATCH 012/182] Handle pre-generated buildnumber --- meta/folder.groovy | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meta/folder.groovy b/meta/folder.groovy index 9951485..d67389f 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -301,8 +301,8 @@ class BuildStampInfo extends GISJsonSerialised { if (s.size() != 4) { script.error("Overriding build stamp: ${buildstamp} is not of the format: 1.2.3.4") } - this.stampprefix = "${s[0]}.${s[1]}.${s[2]}" - script.echo("Stamp prefix overridden to: ${this.stampprefix}") + this.buildstampprefix = "${s[0]}.${s[1]}.${s[2]}" + script.echo("Stamp prefix overridden to: ${this.buildstampprefix}") this.revision = s[3].toInteger() script.echo("Revision overridden to: ${this.revision}") } From 721375a968a1879cdb4e184d27ec13b03852dc7f Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sat, 4 Dec 2021 21:28:24 +0000 Subject: [PATCH 013/182] Defer archiving artifacts to a loaded script --- check/build_meta.groovy | 3 ++- copy/all.groovy | 6 ++++-- copy/esw.groovy | 3 ++- copy/filtered.groovy | 3 ++- copy/logic.groovy | 3 ++- differences/metahierarchy.groovy | 3 ++- publish/promptingpublish.groovy | 3 ++- publish/publish.groovy | 3 ++- release/release.groovy | 3 ++- staticanalysis/cpd.groovy | 3 ++- staticanalysis/cppcheck.groovy | 3 ++- test/testethernetproduct.groovy | 3 ++- 12 files changed, 26 insertions(+), 13 deletions(-) diff --git a/check/build_meta.groovy b/check/build_meta.groovy index 6e669bc..5258740 100644 --- a/check/build_meta.groovy +++ b/check/build_meta.groovy @@ -53,7 +53,8 @@ pipeline { steps { script { def artifactlist = meta.generateartifacts() - archiveArtifacts "summary/**,${artifactlist}" + artifactarchiver = load(${autobuilder.commonscripts()}/artifacts/archiver.groovy) + artifactarchiver.archiveArtifacts("summary/**,${artifactlist}") } } } diff --git a/copy/all.groovy b/copy/all.groovy index 6d09903..5a7e424 100644 --- a/copy/all.groovy +++ b/copy/all.groovy @@ -57,14 +57,16 @@ pipeline { def includes = '**/*' def excludes = "${IMPORTS}/*" echo "Archiving artifacts: Includes: ${includes} Excludes: ${excludes}" - // This does not work: archiveArtifacts artifacts: includes, excludes: excludes + // This does not work: artifactarchiver = load(${autobuilder.commonscripts()}/artifacts/archiver.groovy) + // This does not work: artifactarchiver.archiveArtifacts(artifacts: includes, excludes: excludes) // so cleanfolders = [ IMPORTS, 'autobuild', ] cleaner.clean(cleanfolders) - archiveArtifacts artifacts: includes + artifactarchiver = load(${autobuilder.commonscripts()}/artifacts/archiver.groovy) + artifactarchiver.archiveArtifacts(artifacts: includes) } } } diff --git a/copy/esw.groovy b/copy/esw.groovy index c6c0147..a3f1b23 100644 --- a/copy/esw.groovy +++ b/copy/esw.groovy @@ -41,7 +41,8 @@ pipeline { rm -v -rf meta mv -v "${ESW}"/* . """ - archiveArtifacts artifactlist + artifactarchiver = load(${autobuilder.commonscripts()}/artifacts/archiver.groovy) + artifactarchiver.archiveArtifacts(artifactlist) } } } diff --git a/copy/filtered.groovy b/copy/filtered.groovy index 7fd87b6..f0f6f6a 100644 --- a/copy/filtered.groovy +++ b/copy/filtered.groovy @@ -48,7 +48,8 @@ pipeline { steps { script { def artifactlist = meta.generateartifacts(["filtered/**"]) - archiveArtifacts artifactlist + artifactarchiver = load(${autobuilder.commonscripts()}/artifacts/archiver.groovy) + artifactarchiver.archiveArtifacts(artifactlist) } } } diff --git a/copy/logic.groovy b/copy/logic.groovy index 9585f01..1663904 100644 --- a/copy/logic.groovy +++ b/copy/logic.groovy @@ -43,7 +43,8 @@ pipeline { rm -v -rf diff mv -v "logic"/* . """ - archiveArtifacts artifactlist + artifactarchiver = load(${autobuilder.commonscripts()}/artifacts/archiver.groovy) + artifactarchiver.archiveArtifacts(artifactlist) } } } diff --git a/differences/metahierarchy.groovy b/differences/metahierarchy.groovy index 10b24a0..f7251dc 100644 --- a/differences/metahierarchy.groovy +++ b/differences/metahierarchy.groovy @@ -58,7 +58,8 @@ pipeline { steps { script { def artifactlist = meta.generateartifacts() - archiveArtifacts "summary/**,reports/**,${artifactlist}" + artifactarchiver = load(${autobuilder.commonscripts()}/artifacts/archiver.groovy) + artifactarchiver.archiveArtifacts("summary/**,reports/**,${artifactlist}") } } } diff --git a/publish/promptingpublish.groovy b/publish/promptingpublish.groovy index 9d51915..8d4b702 100644 --- a/publish/promptingpublish.groovy +++ b/publish/promptingpublish.groovy @@ -147,7 +147,8 @@ pipeline { steps { script { def artifactlist = meta.generateartifacts() - archiveArtifacts "summary/**,${artifactlist}" + artifactarchiver = load(${autobuilder.commonscripts()}/artifacts/archiver.groovy) + artifactarchiver.archiveArtifacts("summary/**,${artifactlist}") } } } diff --git a/publish/publish.groovy b/publish/publish.groovy index 82a32ad..38ee12e 100644 --- a/publish/publish.groovy +++ b/publish/publish.groovy @@ -58,7 +58,8 @@ pipeline { steps { script { def artifactlist = meta.generateartifacts() - archiveArtifacts "summary/**,${artifactlist}" + artifactarchiver = load(${autobuilder.commonscripts()}/artifacts/archiver.groovy) + artifactarchiver.archiveArtifacts("summary/**,${artifactlist}") } } } diff --git a/release/release.groovy b/release/release.groovy index 351985d..5be1ccd 100644 --- a/release/release.groovy +++ b/release/release.groovy @@ -56,7 +56,8 @@ pipeline { steps { script { def artifactlist = meta.generateartifacts() - archiveArtifacts "summary/**,${artifactlist}" + artifactarchiver = load(${autobuilder.commonscripts()}/artifacts/archiver.groovy) + artifactarchiver.archiveArtifacts("summary/**,${artifactlist}") } } } diff --git a/staticanalysis/cpd.groovy b/staticanalysis/cpd.groovy index 5a77cab..476734e 100644 --- a/staticanalysis/cpd.groovy +++ b/staticanalysis/cpd.groovy @@ -129,7 +129,8 @@ pipeline { script { ArrayList itemsForRelease = ["${STATICANALYSIS}/**"] def artifactlist = meta.generateartifacts(itemsForRelease) - archiveArtifacts artifactlist + artifactarchiver = load(${autobuilder.commonscripts()}/artifacts/archiver.groovy) + artifactarchiver.archiveArtifacts(artifactlist) } } } diff --git a/staticanalysis/cppcheck.groovy b/staticanalysis/cppcheck.groovy index 9455b0b..fc9345e 100644 --- a/staticanalysis/cppcheck.groovy +++ b/staticanalysis/cppcheck.groovy @@ -91,7 +91,8 @@ pipeline { script { ArrayList itemsForRelease = ["${STATICANALYSIS}/**"] def artifactlist = meta.generateartifacts(itemsForRelease) - archiveArtifacts artifactlist + artifactarchiver = load(${autobuilder.commonscripts()}/artifacts/archiver.groovy) + artifactarchiver.archiveArtifacts(artifactlist) } } } diff --git a/test/testethernetproduct.groovy b/test/testethernetproduct.groovy index 92d6414..79c9ba7 100644 --- a/test/testethernetproduct.groovy +++ b/test/testethernetproduct.groovy @@ -192,7 +192,8 @@ pipeline { steps{ script { def artifactlist = meta.generateartifacts([ "${LOGGING_ROOT}/**"]) - archiveArtifacts artifactlist + artifactarchiver = load(${autobuilder.commonscripts()}/artifacts/archiver.groovy) + artifactarchiver.archiveArtifacts(artifactlist) } } } From 276381321fcdbcc554a66e4590e2976a916ca3fd Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sat, 4 Dec 2021 21:48:27 +0000 Subject: [PATCH 014/182] Add a default archiver --- artifacts/archiver.groovy | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 artifacts/archiver.groovy diff --git a/artifacts/archiver.groovy b/artifacts/archiver.groovy new file mode 100644 index 0000000..d3c05c0 --- /dev/null +++ b/artifacts/archiver.groovy @@ -0,0 +1,16 @@ + +enum ArchiverStore { + JENKINS, + ARTIFACTSERVER, +} + +def archiveArtifacts(artifactlist, ArchiverStore store = JENKINS ) { + if (store == JENKINS) { + archiveArtifacts(artifactlist) + } +} + +this.JENKINS = JENKINS +this.ARTIFACTSERVER = ARTIFACTSERVER + +return this \ No newline at end of file From a91d0d5ff516bbc700d85f2c8ccdbdd0b659eacb Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sat, 4 Dec 2021 22:08:17 +0000 Subject: [PATCH 015/182] Add a default archiver --- check/build_meta.groovy | 2 +- copy/all.groovy | 4 ++-- copy/esw.groovy | 2 +- copy/filtered.groovy | 2 +- copy/logic.groovy | 2 +- differences/metahierarchy.groovy | 2 +- publish/promptingpublish.groovy | 2 +- publish/publish.groovy | 2 +- release/release.groovy | 2 +- staticanalysis/cpd.groovy | 2 +- staticanalysis/cppcheck.groovy | 2 +- test/testethernetproduct.groovy | 2 +- 12 files changed, 13 insertions(+), 13 deletions(-) diff --git a/check/build_meta.groovy b/check/build_meta.groovy index 5258740..04f5d3f 100644 --- a/check/build_meta.groovy +++ b/check/build_meta.groovy @@ -53,7 +53,7 @@ pipeline { steps { script { def artifactlist = meta.generateartifacts() - artifactarchiver = load(${autobuilder.commonscripts()}/artifacts/archiver.groovy) + artifactarchiver = load("${autobuilder.commonscripts()}/artifacts/archiver.groovy") artifactarchiver.archiveArtifacts("summary/**,${artifactlist}") } } diff --git a/copy/all.groovy b/copy/all.groovy index 5a7e424..686ec26 100644 --- a/copy/all.groovy +++ b/copy/all.groovy @@ -57,7 +57,7 @@ pipeline { def includes = '**/*' def excludes = "${IMPORTS}/*" echo "Archiving artifacts: Includes: ${includes} Excludes: ${excludes}" - // This does not work: artifactarchiver = load(${autobuilder.commonscripts()}/artifacts/archiver.groovy) + // This does not work: artifactarchiver = load("${autobuilder.commonscripts()}/artifacts/archiver.groovy") // This does not work: artifactarchiver.archiveArtifacts(artifacts: includes, excludes: excludes) // so cleanfolders = [ @@ -65,7 +65,7 @@ pipeline { 'autobuild', ] cleaner.clean(cleanfolders) - artifactarchiver = load(${autobuilder.commonscripts()}/artifacts/archiver.groovy) + artifactarchiver = load("${autobuilder.commonscripts()}/artifacts/archiver.groovy") artifactarchiver.archiveArtifacts(artifacts: includes) } } diff --git a/copy/esw.groovy b/copy/esw.groovy index a3f1b23..1ccc52d 100644 --- a/copy/esw.groovy +++ b/copy/esw.groovy @@ -41,7 +41,7 @@ pipeline { rm -v -rf meta mv -v "${ESW}"/* . """ - artifactarchiver = load(${autobuilder.commonscripts()}/artifacts/archiver.groovy) + artifactarchiver = load("${autobuilder.commonscripts()}/artifacts/archiver.groovy") artifactarchiver.archiveArtifacts(artifactlist) } } diff --git a/copy/filtered.groovy b/copy/filtered.groovy index f0f6f6a..6ae8257 100644 --- a/copy/filtered.groovy +++ b/copy/filtered.groovy @@ -48,7 +48,7 @@ pipeline { steps { script { def artifactlist = meta.generateartifacts(["filtered/**"]) - artifactarchiver = load(${autobuilder.commonscripts()}/artifacts/archiver.groovy) + artifactarchiver = load("${autobuilder.commonscripts()}/artifacts/archiver.groovy") artifactarchiver.archiveArtifacts(artifactlist) } } diff --git a/copy/logic.groovy b/copy/logic.groovy index 1663904..98e26ca 100644 --- a/copy/logic.groovy +++ b/copy/logic.groovy @@ -43,7 +43,7 @@ pipeline { rm -v -rf diff mv -v "logic"/* . """ - artifactarchiver = load(${autobuilder.commonscripts()}/artifacts/archiver.groovy) + artifactarchiver = load("${autobuilder.commonscripts()}/artifacts/archiver.groovy") artifactarchiver.archiveArtifacts(artifactlist) } } diff --git a/differences/metahierarchy.groovy b/differences/metahierarchy.groovy index f7251dc..78d0641 100644 --- a/differences/metahierarchy.groovy +++ b/differences/metahierarchy.groovy @@ -58,7 +58,7 @@ pipeline { steps { script { def artifactlist = meta.generateartifacts() - artifactarchiver = load(${autobuilder.commonscripts()}/artifacts/archiver.groovy) + artifactarchiver = load("${autobuilder.commonscripts()}/artifacts/archiver.groovy") artifactarchiver.archiveArtifacts("summary/**,reports/**,${artifactlist}") } } diff --git a/publish/promptingpublish.groovy b/publish/promptingpublish.groovy index 8d4b702..57cb1a1 100644 --- a/publish/promptingpublish.groovy +++ b/publish/promptingpublish.groovy @@ -147,7 +147,7 @@ pipeline { steps { script { def artifactlist = meta.generateartifacts() - artifactarchiver = load(${autobuilder.commonscripts()}/artifacts/archiver.groovy) + artifactarchiver = load("${autobuilder.commonscripts()}/artifacts/archiver.groovy") artifactarchiver.archiveArtifacts("summary/**,${artifactlist}") } } diff --git a/publish/publish.groovy b/publish/publish.groovy index 38ee12e..9c26d06 100644 --- a/publish/publish.groovy +++ b/publish/publish.groovy @@ -58,7 +58,7 @@ pipeline { steps { script { def artifactlist = meta.generateartifacts() - artifactarchiver = load(${autobuilder.commonscripts()}/artifacts/archiver.groovy) + artifactarchiver = load("${autobuilder.commonscripts()}/artifacts/archiver.groovy") artifactarchiver.archiveArtifacts("summary/**,${artifactlist}") } } diff --git a/release/release.groovy b/release/release.groovy index 5be1ccd..aa074a1 100644 --- a/release/release.groovy +++ b/release/release.groovy @@ -56,7 +56,7 @@ pipeline { steps { script { def artifactlist = meta.generateartifacts() - artifactarchiver = load(${autobuilder.commonscripts()}/artifacts/archiver.groovy) + artifactarchiver = load("${autobuilder.commonscripts()}/artifacts/archiver.groovy") artifactarchiver.archiveArtifacts("summary/**,${artifactlist}") } } diff --git a/staticanalysis/cpd.groovy b/staticanalysis/cpd.groovy index 476734e..508c726 100644 --- a/staticanalysis/cpd.groovy +++ b/staticanalysis/cpd.groovy @@ -129,7 +129,7 @@ pipeline { script { ArrayList itemsForRelease = ["${STATICANALYSIS}/**"] def artifactlist = meta.generateartifacts(itemsForRelease) - artifactarchiver = load(${autobuilder.commonscripts()}/artifacts/archiver.groovy) + artifactarchiver = load("${autobuilder.commonscripts()}/artifacts/archiver.groovy") artifactarchiver.archiveArtifacts(artifactlist) } } diff --git a/staticanalysis/cppcheck.groovy b/staticanalysis/cppcheck.groovy index fc9345e..2847cac 100644 --- a/staticanalysis/cppcheck.groovy +++ b/staticanalysis/cppcheck.groovy @@ -91,7 +91,7 @@ pipeline { script { ArrayList itemsForRelease = ["${STATICANALYSIS}/**"] def artifactlist = meta.generateartifacts(itemsForRelease) - artifactarchiver = load(${autobuilder.commonscripts()}/artifacts/archiver.groovy) + artifactarchiver = load("${autobuilder.commonscripts()}/artifacts/archiver.groovy") artifactarchiver.archiveArtifacts(artifactlist) } } diff --git a/test/testethernetproduct.groovy b/test/testethernetproduct.groovy index 79c9ba7..9ff1229 100644 --- a/test/testethernetproduct.groovy +++ b/test/testethernetproduct.groovy @@ -192,7 +192,7 @@ pipeline { steps{ script { def artifactlist = meta.generateartifacts([ "${LOGGING_ROOT}/**"]) - artifactarchiver = load(${autobuilder.commonscripts()}/artifacts/archiver.groovy) + artifactarchiver = load("${autobuilder.commonscripts()}/artifacts/archiver.groovy") artifactarchiver.archiveArtifacts(artifactlist) } } From 0f217b8ae2218131dd51f70d893dc8d8f3f460d3 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sat, 4 Dec 2021 22:33:40 +0000 Subject: [PATCH 016/182] Add a default archiver --- artifacts/archiver.groovy | 3 --- 1 file changed, 3 deletions(-) diff --git a/artifacts/archiver.groovy b/artifacts/archiver.groovy index d3c05c0..5278eb3 100644 --- a/artifacts/archiver.groovy +++ b/artifacts/archiver.groovy @@ -10,7 +10,4 @@ def archiveArtifacts(artifactlist, ArchiverStore store = JENKINS ) { } } -this.JENKINS = JENKINS -this.ARTIFACTSERVER = ARTIFACTSERVER - return this \ No newline at end of file From 0602daedfab5e061fa22e6390ab862ef94230e6b Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sat, 4 Dec 2021 22:45:04 +0000 Subject: [PATCH 017/182] Add a default archiver --- artifacts/archiver.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/artifacts/archiver.groovy b/artifacts/archiver.groovy index 5278eb3..f7dc583 100644 --- a/artifacts/archiver.groovy +++ b/artifacts/archiver.groovy @@ -4,7 +4,7 @@ enum ArchiverStore { ARTIFACTSERVER, } -def archiveArtifacts(artifactlist, ArchiverStore store = JENKINS ) { +def archiveArtifacts(artifactlist, ArchiverStore store = ArchiverStore.JENKINS ) { if (store == JENKINS) { archiveArtifacts(artifactlist) } From a301529e377ff0c47f3fbd2a144aa652c827f4b4 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sat, 4 Dec 2021 22:51:02 +0000 Subject: [PATCH 018/182] Add a default archiver --- artifacts/archiver.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/artifacts/archiver.groovy b/artifacts/archiver.groovy index f7dc583..bd2d241 100644 --- a/artifacts/archiver.groovy +++ b/artifacts/archiver.groovy @@ -5,7 +5,7 @@ enum ArchiverStore { } def archiveArtifacts(artifactlist, ArchiverStore store = ArchiverStore.JENKINS ) { - if (store == JENKINS) { + if (store == ArchiverStore.JENKINS) { archiveArtifacts(artifactlist) } } From 8d3afbb8cbae10d92e5dfe70482cb7c5421e39fc Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sat, 4 Dec 2021 22:57:45 +0000 Subject: [PATCH 019/182] Add a default archiver --- artifacts/archiver.groovy | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/artifacts/archiver.groovy b/artifacts/archiver.groovy index bd2d241..ee36f24 100644 --- a/artifacts/archiver.groovy +++ b/artifacts/archiver.groovy @@ -4,8 +4,11 @@ enum ArchiverStore { ARTIFACTSERVER, } -def archiveArtifacts(artifactlist, ArchiverStore store = ArchiverStore.JENKINS ) { - if (store == ArchiverStore.JENKINS) { +this.JENKINS = ArchiverStore.JENKINS +this.ARTIFACTSERVER = ArchiverStore.JENKINS + +def archiveArtifacts(artifactlist, ArchiverStore store = JENKINS ) { + if (store == JENKINS) { archiveArtifacts(artifactlist) } } From 8c2b3ab93a38574921595f030fb450d4a146f1af Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sat, 4 Dec 2021 22:59:59 +0000 Subject: [PATCH 020/182] Add a default archiver --- artifacts/archiver.groovy | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/artifacts/archiver.groovy b/artifacts/archiver.groovy index ee36f24..bc365af 100644 --- a/artifacts/archiver.groovy +++ b/artifacts/archiver.groovy @@ -1,13 +1,8 @@ -enum ArchiverStore { - JENKINS, - ARTIFACTSERVER, -} +JENKINS = 0 +ARTIFACTSERVER = 1 -this.JENKINS = ArchiverStore.JENKINS -this.ARTIFACTSERVER = ArchiverStore.JENKINS - -def archiveArtifacts(artifactlist, ArchiverStore store = JENKINS ) { +def archiveArtifacts(artifactlist, store = JENKINS ) { if (store == JENKINS) { archiveArtifacts(artifactlist) } From cb65d2b730d60e50b07125420101ccce20ba5874 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sat, 4 Dec 2021 23:24:51 +0000 Subject: [PATCH 021/182] Add a default archiver --- artifacts/archiver.groovy | 10 +++++++--- check/build_meta.groovy | 2 +- copy/all.groovy | 4 ++-- copy/esw.groovy | 2 +- copy/filtered.groovy | 2 +- copy/logic.groovy | 2 +- differences/metahierarchy.groovy | 2 +- publish/promptingpublish.groovy | 2 +- publish/publish.groovy | 2 +- release/release.groovy | 2 +- staticanalysis/cpd.groovy | 2 +- staticanalysis/cppcheck.groovy | 2 +- test/testethernetproduct.groovy | 2 +- 13 files changed, 20 insertions(+), 16 deletions(-) diff --git a/artifacts/archiver.groovy b/artifacts/archiver.groovy index bc365af..30360d0 100644 --- a/artifacts/archiver.groovy +++ b/artifacts/archiver.groovy @@ -1,8 +1,12 @@ +enum Store { + JENKINS, + ARTIFACTSERVER, +} -JENKINS = 0 -ARTIFACTSERVER = 1 +this.JENKINS = Store.JENKINS +this.ARTIFACTSERVER = Store.JENKINS -def archiveArtifacts(artifactlist, store = JENKINS ) { +def archive(artifactlist, ArchiverStore store = JENKINS ) { if (store == JENKINS) { archiveArtifacts(artifactlist) } diff --git a/check/build_meta.groovy b/check/build_meta.groovy index 04f5d3f..fb8a75d 100644 --- a/check/build_meta.groovy +++ b/check/build_meta.groovy @@ -54,7 +54,7 @@ pipeline { script { def artifactlist = meta.generateartifacts() artifactarchiver = load("${autobuilder.commonscripts()}/artifacts/archiver.groovy") - artifactarchiver.archiveArtifacts("summary/**,${artifactlist}") + artifactarchiver.archive("summary/**,${artifactlist}") } } } diff --git a/copy/all.groovy b/copy/all.groovy index 686ec26..9b95eb6 100644 --- a/copy/all.groovy +++ b/copy/all.groovy @@ -58,7 +58,7 @@ pipeline { def excludes = "${IMPORTS}/*" echo "Archiving artifacts: Includes: ${includes} Excludes: ${excludes}" // This does not work: artifactarchiver = load("${autobuilder.commonscripts()}/artifacts/archiver.groovy") - // This does not work: artifactarchiver.archiveArtifacts(artifacts: includes, excludes: excludes) + // This does not work: artifactarchiver.archive(artifacts: includes, excludes: excludes) // so cleanfolders = [ IMPORTS, @@ -66,7 +66,7 @@ pipeline { ] cleaner.clean(cleanfolders) artifactarchiver = load("${autobuilder.commonscripts()}/artifacts/archiver.groovy") - artifactarchiver.archiveArtifacts(artifacts: includes) + artifactarchiver.archive(artifacts: includes) } } } diff --git a/copy/esw.groovy b/copy/esw.groovy index 1ccc52d..6ccb53e 100644 --- a/copy/esw.groovy +++ b/copy/esw.groovy @@ -42,7 +42,7 @@ pipeline { mv -v "${ESW}"/* . """ artifactarchiver = load("${autobuilder.commonscripts()}/artifacts/archiver.groovy") - artifactarchiver.archiveArtifacts(artifactlist) + artifactarchiver.archive(artifactlist) } } } diff --git a/copy/filtered.groovy b/copy/filtered.groovy index 6ae8257..251de93 100644 --- a/copy/filtered.groovy +++ b/copy/filtered.groovy @@ -49,7 +49,7 @@ pipeline { script { def artifactlist = meta.generateartifacts(["filtered/**"]) artifactarchiver = load("${autobuilder.commonscripts()}/artifacts/archiver.groovy") - artifactarchiver.archiveArtifacts(artifactlist) + artifactarchiver.archive(artifactlist) } } } diff --git a/copy/logic.groovy b/copy/logic.groovy index 98e26ca..7b20935 100644 --- a/copy/logic.groovy +++ b/copy/logic.groovy @@ -44,7 +44,7 @@ pipeline { mv -v "logic"/* . """ artifactarchiver = load("${autobuilder.commonscripts()}/artifacts/archiver.groovy") - artifactarchiver.archiveArtifacts(artifactlist) + artifactarchiver.archive(artifactlist) } } } diff --git a/differences/metahierarchy.groovy b/differences/metahierarchy.groovy index 78d0641..60d9835 100644 --- a/differences/metahierarchy.groovy +++ b/differences/metahierarchy.groovy @@ -59,7 +59,7 @@ pipeline { script { def artifactlist = meta.generateartifacts() artifactarchiver = load("${autobuilder.commonscripts()}/artifacts/archiver.groovy") - artifactarchiver.archiveArtifacts("summary/**,reports/**,${artifactlist}") + artifactarchiver.archive("summary/**,reports/**,${artifactlist}") } } } diff --git a/publish/promptingpublish.groovy b/publish/promptingpublish.groovy index 57cb1a1..58c72eb 100644 --- a/publish/promptingpublish.groovy +++ b/publish/promptingpublish.groovy @@ -148,7 +148,7 @@ pipeline { script { def artifactlist = meta.generateartifacts() artifactarchiver = load("${autobuilder.commonscripts()}/artifacts/archiver.groovy") - artifactarchiver.archiveArtifacts("summary/**,${artifactlist}") + artifactarchiver.archive("summary/**,${artifactlist}") } } } diff --git a/publish/publish.groovy b/publish/publish.groovy index 9c26d06..ad33df9 100644 --- a/publish/publish.groovy +++ b/publish/publish.groovy @@ -59,7 +59,7 @@ pipeline { script { def artifactlist = meta.generateartifacts() artifactarchiver = load("${autobuilder.commonscripts()}/artifacts/archiver.groovy") - artifactarchiver.archiveArtifacts("summary/**,${artifactlist}") + artifactarchiver.archive("summary/**,${artifactlist}") } } } diff --git a/release/release.groovy b/release/release.groovy index aa074a1..42357fc 100644 --- a/release/release.groovy +++ b/release/release.groovy @@ -57,7 +57,7 @@ pipeline { script { def artifactlist = meta.generateartifacts() artifactarchiver = load("${autobuilder.commonscripts()}/artifacts/archiver.groovy") - artifactarchiver.archiveArtifacts("summary/**,${artifactlist}") + artifactarchiver.archive("summary/**,${artifactlist}") } } } diff --git a/staticanalysis/cpd.groovy b/staticanalysis/cpd.groovy index 508c726..f9ddfcb 100644 --- a/staticanalysis/cpd.groovy +++ b/staticanalysis/cpd.groovy @@ -130,7 +130,7 @@ pipeline { ArrayList itemsForRelease = ["${STATICANALYSIS}/**"] def artifactlist = meta.generateartifacts(itemsForRelease) artifactarchiver = load("${autobuilder.commonscripts()}/artifacts/archiver.groovy") - artifactarchiver.archiveArtifacts(artifactlist) + artifactarchiver.archive(artifactlist) } } } diff --git a/staticanalysis/cppcheck.groovy b/staticanalysis/cppcheck.groovy index 2847cac..696f11d 100644 --- a/staticanalysis/cppcheck.groovy +++ b/staticanalysis/cppcheck.groovy @@ -92,7 +92,7 @@ pipeline { ArrayList itemsForRelease = ["${STATICANALYSIS}/**"] def artifactlist = meta.generateartifacts(itemsForRelease) artifactarchiver = load("${autobuilder.commonscripts()}/artifacts/archiver.groovy") - artifactarchiver.archiveArtifacts(artifactlist) + artifactarchiver.archive(artifactlist) } } } diff --git a/test/testethernetproduct.groovy b/test/testethernetproduct.groovy index 9ff1229..f45cf19 100644 --- a/test/testethernetproduct.groovy +++ b/test/testethernetproduct.groovy @@ -193,7 +193,7 @@ pipeline { script { def artifactlist = meta.generateartifacts([ "${LOGGING_ROOT}/**"]) artifactarchiver = load("${autobuilder.commonscripts()}/artifacts/archiver.groovy") - artifactarchiver.archiveArtifacts(artifactlist) + artifactarchiver.archive(artifactlist) } } } From c98990423a6215d77df106987dd95232ab0679d2 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sat, 4 Dec 2021 23:27:31 +0000 Subject: [PATCH 022/182] Add a default archiver --- artifacts/archiver.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/artifacts/archiver.groovy b/artifacts/archiver.groovy index 30360d0..d7b69d0 100644 --- a/artifacts/archiver.groovy +++ b/artifacts/archiver.groovy @@ -6,7 +6,7 @@ enum Store { this.JENKINS = Store.JENKINS this.ARTIFACTSERVER = Store.JENKINS -def archive(artifactlist, ArchiverStore store = JENKINS ) { +def archive(artifactlist, Store store = JENKINS ) { if (store == JENKINS) { archiveArtifacts(artifactlist) } From e75eb96a20cc8b2b449e56bfd1bc8be8bda4c7f3 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sun, 5 Dec 2021 20:40:53 +0000 Subject: [PATCH 023/182] Handle long version number strings eg. in sha codes --- versionnumbering/generate.groovy | 3 +++ 1 file changed, 3 insertions(+) diff --git a/versionnumbering/generate.groovy b/versionnumbering/generate.groovy index 7b435c4..5e974e2 100644 --- a/versionnumbering/generate.groovy +++ b/versionnumbering/generate.groovy @@ -98,6 +98,9 @@ def getVersionPrefix(String sourcebranch, boolean droptrailingdot = false) { def integerstrings = sourcebranch.findAll(/\d+/) def integers = [] for (integerstring in integerstrings) { + if (integerstring.length() > 6) { + integerstring = integerstring.substring(0, 5) + } int integer = integerstring.toInteger() integer = integer % (maxversionnumber() + 1) integers.add(integer) From 74ad66b19964a07c2b14ea0a727234db1446dd49 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Fri, 10 Dec 2021 17:10:24 +0000 Subject: [PATCH 024/182] Start writing format version into meta data file --- meta/folder.groovy | 49 +++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 46 insertions(+), 3 deletions(-) diff --git a/meta/folder.groovy b/meta/folder.groovy index d67389f..70d024a 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -20,12 +20,14 @@ abstract class GISJsonSerialised implements Serializable { } class ProductInfo extends GISJsonSerialised { + private static String FORMAT = '0.1' String productname String subcomponentname String variant ProductInfo(script, productname = "", subcomponentname = "", variant = "") { super(script) + this.format = FORMAT this.productname = productname this.subcomponentname = subcomponentname this.variant = variant @@ -77,6 +79,7 @@ class ProductInfo extends GISJsonSerialised { } void deserialiseJson(rawmeta) { + //format = rawmeta['format'] productname = rawmeta['productname'] subcomponentname = rawmeta['subcomponentname'] variant = rawmeta['variant'] ?: "" @@ -84,6 +87,7 @@ class ProductInfo extends GISJsonSerialised { LinkedHashMap serialisationdata() { def data = [ + 'format' : format, 'productname' : productname, 'subcomponentname' : subcomponentname, 'variant' : variant, @@ -93,6 +97,7 @@ class ProductInfo extends GISJsonSerialised { } class GitInfo extends GISJsonSerialised { + private static String FORMAT = '0.1' private String sourcepath private String sourcerevision private String gitrevision @@ -101,6 +106,7 @@ class GitInfo extends GISJsonSerialised { GitInfo(script, sourcepath = "", sourcerevision = "", gitrevision = "", remoteurl = "", remoteinfo = "") { super(script) + this.format = FORMAT this.sourcepath = sourcepath this.sourcerevision = sourcerevision this.gitrevision = gitrevision @@ -134,6 +140,7 @@ class GitInfo extends GISJsonSerialised { } void deserialiseJson(rawmeta) { + //format = rawmeta['format'] sourcepath = rawmeta['sourcepath'] sourcerevision = rawmeta['sourcerevision'] gitrevision = rawmeta['gitrevision'] @@ -143,6 +150,7 @@ class GitInfo extends GISJsonSerialised { LinkedHashMap serialisationdata() { def data = [ + 'format' : format, 'sourcepath' : sourcepath, 'sourcerevision' : sourcerevision, 'gitrevision' : gitrevision, @@ -154,12 +162,14 @@ class GitInfo extends GISJsonSerialised { } class JenkinsBuildParameter extends GISJsonSerialised { + private static String FORMAT = '0.1' private String name private String valuetype private String value JenkinsBuildParameter(script, String name = '', String valuetype = '', String value = '') { super(script) + this.format = FORMAT this.name = name this.valuetype = valuetype this.value = value @@ -172,6 +182,7 @@ class JenkinsBuildParameter extends GISJsonSerialised { } void deserialiseJson(rawmeta) { + //format = rawmeta['format'] name = rawmeta['name'] valuetype = rawmeta['valuetype'] value = rawmeta['value'] @@ -179,6 +190,7 @@ class JenkinsBuildParameter extends GISJsonSerialised { LinkedHashMap serialisationdata() { def data = [ + 'format' : format, 'name' : name, 'valuetype' : valuetype, 'value' : value, @@ -188,6 +200,7 @@ class JenkinsBuildParameter extends GISJsonSerialised { } class JenkinsBuildInfo extends GISJsonSerialised { + private static String FORMAT = '0.1' String buildjobname int buildnumber private String buildmachine @@ -197,6 +210,7 @@ class JenkinsBuildInfo extends GISJsonSerialised { JenkinsBuildInfo(script, String buildjobname = "", int buildnumber = 0, String buildmachine = "", String builddate = "", boolean isfullbuild = true) { super(script) + this.format = FORMAT this.buildjobname = buildjobname this.buildnumber = buildnumber this.buildmachine = buildmachine @@ -228,6 +242,7 @@ class JenkinsBuildInfo extends GISJsonSerialised { } void deserialiseJson(rawmeta) { + //format = rawmeta['format'] buildjobname = rawmeta['buildjobname'] buildnumber = rawmeta['buildnumber'] buildmachine = rawmeta['buildmachine'] @@ -253,6 +268,7 @@ class JenkinsBuildInfo extends GISJsonSerialised { LinkedHashMap serialisationdata() { def data = [ + 'format' : format, 'buildjobname' : buildjobname, 'buildnumber' : buildnumber, 'buildmachine' : buildmachine, @@ -265,12 +281,14 @@ class JenkinsBuildInfo extends GISJsonSerialised { } class BuildStampInfo extends GISJsonSerialised { + private static String FORMAT = '0.1' String buildstampprefix int revision String buildstamp BuildStampInfo(script, buildstampprefix = "0.30000.0.", revision = 0, buildstamp = "0.30000.0.0") { super(script) + this.format = FORMAT this.buildstampprefix = buildstampprefix this.revision = revision this.buildstamp = buildstamp @@ -333,6 +351,7 @@ class BuildStampInfo extends GISJsonSerialised { } void deserialiseJson(rawmeta) { + //format = rawmeta['format'] buildstampprefix = rawmeta['buildstampprefix'] revision = rawmeta['revision'] buildstamp = rawmeta['buildstamp'] @@ -340,6 +359,7 @@ class BuildStampInfo extends GISJsonSerialised { LinkedHashMap serialisationdata() { def data = [ + 'format' : format, 'buildstampprefix' : buildstampprefix, 'revision' : revision, 'buildstamp' : buildstamp, @@ -349,12 +369,14 @@ class BuildStampInfo extends GISJsonSerialised { } class ReleaseInfo extends GISJsonSerialised { + private static String FORMAT = '0.1' String releaserepoURL ArrayList releaseitems boolean released ReleaseInfo(script, String releaserepoURL = "", boolean released = false) { super(script) + this.format = FORMAT this.releaserepoURL = releaserepoURL this.releaseitems = new ArrayList() this.released = released @@ -382,6 +404,7 @@ class ReleaseInfo extends GISJsonSerialised { } void deserialiseJson(rawmeta) { + //format = rawmeta['format'] releaserepoURL = rawmeta['releaserepoURL'] releaseitems = new ArrayList() for (rawreleaseitem in rawmeta['releaseitems']) { @@ -392,6 +415,7 @@ class ReleaseInfo extends GISJsonSerialised { LinkedHashMap serialisationdata() { def data = [ + 'format' : format, 'releaserepoURL' : releaserepoURL, 'releaseitems' : releaseitemssserialised(), 'released' : released @@ -401,6 +425,7 @@ class ReleaseInfo extends GISJsonSerialised { } class ConfigurationInfo extends GISJsonSerialised { + private static String FORMAT = '0.1' private String configurationname private String configurationURL private String configurationversion @@ -408,6 +433,7 @@ class ConfigurationInfo extends GISJsonSerialised { ConfigurationInfo(script, configurationname = "", configurationURL = "", configurationversion = "", configurationSHA = "") { super(script) + this.format = FORMAT this.configurationname = configurationname this.configurationURL = configurationURL this.configurationversion = configurationversion @@ -415,6 +441,7 @@ class ConfigurationInfo extends GISJsonSerialised { } void deserialiseJson(rawmeta) { + //format = rawmeta['format'] configurationname = rawmeta['configurationname'] configurationURL = rawmeta['configurationURL'] configurationversion = rawmeta['configurationversion'] @@ -423,6 +450,7 @@ class ConfigurationInfo extends GISJsonSerialised { LinkedHashMap serialisationdata() { def data = [ + 'format' : format, 'configurationname' : configurationname, 'configurationURL' : configurationURL, 'configurationversion' : configurationversion, @@ -457,11 +485,13 @@ class ChecksumPair extends GISJsonSerialised { } class ChecksumSet extends GISJsonSerialised { + private static String FORMAT = '0.1' private String artifactpath private ArrayList checksumpairs ChecksumSet(script, artifactpath = "") { super(script) + this.format = FORMAT this.artifactpath = artifactpath checksumpairs = new ArrayList() } @@ -481,6 +511,7 @@ class ChecksumSet extends GISJsonSerialised { } void deserialiseJson(rawmeta) { + //format = rawmeta['format'] artifactpath = rawmeta['artifactpath'] checksumpairs = new ArrayList() for (rawchecksumpair in rawmeta['checksumpairs']) { @@ -492,6 +523,7 @@ class ChecksumSet extends GISJsonSerialised { LinkedHashMap serialisationdata() { def data = [ + 'format' : format, 'artifactpath' : artifactpath, 'checksumpairs' : checksumpairsserialised(), ] @@ -500,10 +532,12 @@ class ChecksumSet extends GISJsonSerialised { } class ChecksumInfo extends GISJsonSerialised { + private static String FORMAT = '0.1' private ArrayList checksumsets ChecksumInfo(script) { super(script) + this.format = FORMAT checksumsets = new ArrayList() } @@ -522,6 +556,7 @@ class ChecksumInfo extends GISJsonSerialised { } void deserialiseJson(rawmeta) { + //format = rawmeta['format'] checksumsets = new ArrayList() for (rawchecksumset in rawmeta['checksumsets']) { def cs = new ChecksumSet(script) @@ -532,6 +567,7 @@ class ChecksumInfo extends GISJsonSerialised { LinkedHashMap serialisationdata() { def data = [ + 'format' : format, 'checksumsets' : checksumsetsserialised(), ] return data @@ -539,19 +575,23 @@ class ChecksumInfo extends GISJsonSerialised { } class PublishableInfo extends GISJsonSerialised { + private static String FORMAT = '0.1' private String filepath PublishableInfo(script, String filepath = "") { super(script) + this.format = FORMAT this.filepath = filepath } void deserialiseJson(rawmeta) { + //format = rawmeta['format'] filepath = rawmeta['filepath'] } LinkedHashMap serialisationdata() { def data = [ + 'format' : format, 'filepath' : filepath, ] return data @@ -559,9 +599,9 @@ class PublishableInfo extends GISJsonSerialised { } class MetaInfo extends GISJsonSerialised { - private static String FORMAT = "0.1" - private static String METAFOLDERNAME = "meta" - private static String METAFILENAME = "info.json" + private static String FORMAT = '0.1' + private static String METAFOLDERNAME = 'meta' + private static String METAFILENAME = 'info.json' private static String METAARTIFACTS = "${METAFOLDERNAME}/**" class RelatedMetaInfo extends GISJsonSerialised { @@ -570,11 +610,13 @@ class MetaInfo extends GISJsonSerialised { RelatedMetaInfo(script, offsetpath = "", MetaInfo meta = null) { super(script) + this.format = FORMAT this.offsetpath = offsetpath this.meta = meta } void deserialiseJson(rawmeta) { + //format = rawmeta['format'] offsetpath = rawmeta['offsetpath'] meta = new MetaInfo(script) meta.deserialiseJson(rawmeta['meta']) @@ -582,6 +624,7 @@ class MetaInfo extends GISJsonSerialised { LinkedHashMap serialisationdata() { def data = [ + 'format' : format, 'offsetpath' : offsetpath, 'meta' : meta.serialisationdata(), ] From c66149252d3ceb2370c99ce34f10ed61c9ee2bfe Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Fri, 10 Dec 2021 17:26:02 +0000 Subject: [PATCH 025/182] Start writing format version into meta data file --- meta/folder.groovy | 39 ++++++++++++++------------------------- 1 file changed, 14 insertions(+), 25 deletions(-) diff --git a/meta/folder.groovy b/meta/folder.groovy index 70d024a..9b4452a 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -20,14 +20,13 @@ abstract class GISJsonSerialised implements Serializable { } class ProductInfo extends GISJsonSerialised { - private static String FORMAT = '0.1' String productname String subcomponentname String variant ProductInfo(script, productname = "", subcomponentname = "", variant = "") { super(script) - this.format = FORMAT + this.format = '0.1' this.productname = productname this.subcomponentname = subcomponentname this.variant = variant @@ -97,7 +96,6 @@ class ProductInfo extends GISJsonSerialised { } class GitInfo extends GISJsonSerialised { - private static String FORMAT = '0.1' private String sourcepath private String sourcerevision private String gitrevision @@ -106,7 +104,7 @@ class GitInfo extends GISJsonSerialised { GitInfo(script, sourcepath = "", sourcerevision = "", gitrevision = "", remoteurl = "", remoteinfo = "") { super(script) - this.format = FORMAT + this.format = '0.1' this.sourcepath = sourcepath this.sourcerevision = sourcerevision this.gitrevision = gitrevision @@ -162,14 +160,13 @@ class GitInfo extends GISJsonSerialised { } class JenkinsBuildParameter extends GISJsonSerialised { - private static String FORMAT = '0.1' private String name private String valuetype private String value JenkinsBuildParameter(script, String name = '', String valuetype = '', String value = '') { super(script) - this.format = FORMAT + this.format = '0.1' this.name = name this.valuetype = valuetype this.value = value @@ -200,7 +197,6 @@ class JenkinsBuildParameter extends GISJsonSerialised { } class JenkinsBuildInfo extends GISJsonSerialised { - private static String FORMAT = '0.1' String buildjobname int buildnumber private String buildmachine @@ -210,7 +206,7 @@ class JenkinsBuildInfo extends GISJsonSerialised { JenkinsBuildInfo(script, String buildjobname = "", int buildnumber = 0, String buildmachine = "", String builddate = "", boolean isfullbuild = true) { super(script) - this.format = FORMAT + this.format = '0.1' this.buildjobname = buildjobname this.buildnumber = buildnumber this.buildmachine = buildmachine @@ -281,14 +277,13 @@ class JenkinsBuildInfo extends GISJsonSerialised { } class BuildStampInfo extends GISJsonSerialised { - private static String FORMAT = '0.1' String buildstampprefix int revision String buildstamp BuildStampInfo(script, buildstampprefix = "0.30000.0.", revision = 0, buildstamp = "0.30000.0.0") { super(script) - this.format = FORMAT + this.format = '0.1' this.buildstampprefix = buildstampprefix this.revision = revision this.buildstamp = buildstamp @@ -369,14 +364,13 @@ class BuildStampInfo extends GISJsonSerialised { } class ReleaseInfo extends GISJsonSerialised { - private static String FORMAT = '0.1' String releaserepoURL ArrayList releaseitems boolean released ReleaseInfo(script, String releaserepoURL = "", boolean released = false) { super(script) - this.format = FORMAT + this.format = '0.1' this.releaserepoURL = releaserepoURL this.releaseitems = new ArrayList() this.released = released @@ -425,7 +419,6 @@ class ReleaseInfo extends GISJsonSerialised { } class ConfigurationInfo extends GISJsonSerialised { - private static String FORMAT = '0.1' private String configurationname private String configurationURL private String configurationversion @@ -433,7 +426,7 @@ class ConfigurationInfo extends GISJsonSerialised { ConfigurationInfo(script, configurationname = "", configurationURL = "", configurationversion = "", configurationSHA = "") { super(script) - this.format = FORMAT + this.format = '0.1' this.configurationname = configurationname this.configurationURL = configurationURL this.configurationversion = configurationversion @@ -485,13 +478,12 @@ class ChecksumPair extends GISJsonSerialised { } class ChecksumSet extends GISJsonSerialised { - private static String FORMAT = '0.1' private String artifactpath private ArrayList checksumpairs ChecksumSet(script, artifactpath = "") { super(script) - this.format = FORMAT + this.format = '0.1' this.artifactpath = artifactpath checksumpairs = new ArrayList() } @@ -532,12 +524,11 @@ class ChecksumSet extends GISJsonSerialised { } class ChecksumInfo extends GISJsonSerialised { - private static String FORMAT = '0.1' private ArrayList checksumsets ChecksumInfo(script) { super(script) - this.format = FORMAT + this.format = '0.1' checksumsets = new ArrayList() } @@ -575,12 +566,11 @@ class ChecksumInfo extends GISJsonSerialised { } class PublishableInfo extends GISJsonSerialised { - private static String FORMAT = '0.1' private String filepath PublishableInfo(script, String filepath = "") { super(script) - this.format = FORMAT + this.format = '0.1' this.filepath = filepath } @@ -599,7 +589,6 @@ class PublishableInfo extends GISJsonSerialised { } class MetaInfo extends GISJsonSerialised { - private static String FORMAT = '0.1' private static String METAFOLDERNAME = 'meta' private static String METAFILENAME = 'info.json' private static String METAARTIFACTS = "${METAFOLDERNAME}/**" @@ -610,7 +599,7 @@ class MetaInfo extends GISJsonSerialised { RelatedMetaInfo(script, offsetpath = "", MetaInfo meta = null) { super(script) - this.format = FORMAT + this.format = '0.1' this.offsetpath = offsetpath this.meta = meta } @@ -632,7 +621,7 @@ class MetaInfo extends GISJsonSerialised { } } - private String format = FORMAT + private String format = '0.1' ProductInfo productinfo GitInfo gitinfo JenkinsBuildInfo jenkinsbuildinfo @@ -720,7 +709,7 @@ class MetaInfo extends GISJsonSerialised { } void deserialiseJson(rawmeta) { - if (rawmeta['format'] != FORMAT) { + if (rawmeta['format'] != '0.1') { script.error("Unsupported meta format found at ${filepath}") return } @@ -969,9 +958,9 @@ class MetaInfo extends GISJsonSerialised { } MetaInfo metareset(script) { - echo "Resetting meta folder" def mi = new MetaInfo(script) + echo "Resetting meta folder" dir(mi.folder()) { deleteDir() } From df492c865a00124636569d39180756641abc0ff4 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Fri, 10 Dec 2021 17:31:21 +0000 Subject: [PATCH 026/182] Start writing format version into meta data file --- meta/folder.groovy | 53 ++++++++++++++++++++++++++++------------------ 1 file changed, 32 insertions(+), 21 deletions(-) diff --git a/meta/folder.groovy b/meta/folder.groovy index 9b4452a..806b6ff 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -20,9 +20,10 @@ abstract class GISJsonSerialised implements Serializable { } class ProductInfo extends GISJsonSerialised { - String productname - String subcomponentname - String variant + private String format + private String productname + private String subcomponentname + private String variant ProductInfo(script, productname = "", subcomponentname = "", variant = "") { super(script) @@ -96,6 +97,7 @@ class ProductInfo extends GISJsonSerialised { } class GitInfo extends GISJsonSerialised { + private String format private String sourcepath private String sourcerevision private String gitrevision @@ -160,6 +162,7 @@ class GitInfo extends GISJsonSerialised { } class JenkinsBuildParameter extends GISJsonSerialised { + private String format private String name private String valuetype private String value @@ -197,12 +200,13 @@ class JenkinsBuildParameter extends GISJsonSerialised { } class JenkinsBuildInfo extends GISJsonSerialised { - String buildjobname - int buildnumber + private String format + private String buildjobname + private int buildnumber private String buildmachine private String builddate - ArrayList parameters - boolean isfullbuild + private ArrayList parameters + private boolean isfullbuild JenkinsBuildInfo(script, String buildjobname = "", int buildnumber = 0, String buildmachine = "", String builddate = "", boolean isfullbuild = true) { super(script) @@ -277,9 +281,10 @@ class JenkinsBuildInfo extends GISJsonSerialised { } class BuildStampInfo extends GISJsonSerialised { - String buildstampprefix - int revision - String buildstamp + private String format + private String buildstampprefix + private int revision + private String buildstamp BuildStampInfo(script, buildstampprefix = "0.30000.0.", revision = 0, buildstamp = "0.30000.0.0") { super(script) @@ -364,9 +369,10 @@ class BuildStampInfo extends GISJsonSerialised { } class ReleaseInfo extends GISJsonSerialised { - String releaserepoURL - ArrayList releaseitems - boolean released + private String format + private String releaserepoURL + private ArrayList releaseitems + private boolean released ReleaseInfo(script, String releaserepoURL = "", boolean released = false) { super(script) @@ -419,6 +425,7 @@ class ReleaseInfo extends GISJsonSerialised { } class ConfigurationInfo extends GISJsonSerialised { + private String format private String configurationname private String configurationURL private String configurationversion @@ -478,6 +485,7 @@ class ChecksumPair extends GISJsonSerialised { } class ChecksumSet extends GISJsonSerialised { + private String format private String artifactpath private ArrayList checksumpairs @@ -524,6 +532,7 @@ class ChecksumSet extends GISJsonSerialised { } class ChecksumInfo extends GISJsonSerialised { + private String format private ArrayList checksumsets ChecksumInfo(script) { @@ -566,6 +575,7 @@ class ChecksumInfo extends GISJsonSerialised { } class PublishableInfo extends GISJsonSerialised { + private String format private String filepath PublishableInfo(script, String filepath = "") { @@ -594,8 +604,9 @@ class MetaInfo extends GISJsonSerialised { private static String METAARTIFACTS = "${METAFOLDERNAME}/**" class RelatedMetaInfo extends GISJsonSerialised { - String offsetpath - MetaInfo meta + private String format + private String offsetpath + private MetaInfo meta RelatedMetaInfo(script, offsetpath = "", MetaInfo meta = null) { super(script) @@ -622,12 +633,12 @@ class MetaInfo extends GISJsonSerialised { } private String format = '0.1' - ProductInfo productinfo - GitInfo gitinfo - JenkinsBuildInfo jenkinsbuildinfo - BuildStampInfo buildstampinfo - ReleaseInfo releaseinfo - ChecksumInfo checksuminfo + private ProductInfo productinfo + private GitInfo gitinfo + private JenkinsBuildInfo jenkinsbuildinfo + private BuildStampInfo buildstampinfo + private ReleaseInfo releaseinfo + private ChecksumInfo checksuminfo private ArrayList configurationinfo private ArrayList publishableinfo private LinkedHashMap custominfo From 0701945bab8ac31fdc2080f81e5c89e63a8f6c2a Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Fri, 10 Dec 2021 17:41:14 +0000 Subject: [PATCH 027/182] Start writing format version into meta data file --- meta/folder.groovy | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/meta/folder.groovy b/meta/folder.groovy index 806b6ff..4efb0d2 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -162,14 +162,12 @@ class GitInfo extends GISJsonSerialised { } class JenkinsBuildParameter extends GISJsonSerialised { - private String format private String name private String valuetype private String value JenkinsBuildParameter(script, String name = '', String valuetype = '', String value = '') { super(script) - this.format = '0.1' this.name = name this.valuetype = valuetype this.value = value @@ -182,7 +180,6 @@ class JenkinsBuildParameter extends GISJsonSerialised { } void deserialiseJson(rawmeta) { - //format = rawmeta['format'] name = rawmeta['name'] valuetype = rawmeta['valuetype'] value = rawmeta['value'] @@ -190,7 +187,6 @@ class JenkinsBuildParameter extends GISJsonSerialised { LinkedHashMap serialisationdata() { def data = [ - 'format' : format, 'name' : name, 'valuetype' : valuetype, 'value' : value, @@ -425,7 +421,6 @@ class ReleaseInfo extends GISJsonSerialised { } class ConfigurationInfo extends GISJsonSerialised { - private String format private String configurationname private String configurationURL private String configurationversion @@ -433,7 +428,6 @@ class ConfigurationInfo extends GISJsonSerialised { ConfigurationInfo(script, configurationname = "", configurationURL = "", configurationversion = "", configurationSHA = "") { super(script) - this.format = '0.1' this.configurationname = configurationname this.configurationURL = configurationURL this.configurationversion = configurationversion @@ -441,7 +435,6 @@ class ConfigurationInfo extends GISJsonSerialised { } void deserialiseJson(rawmeta) { - //format = rawmeta['format'] configurationname = rawmeta['configurationname'] configurationURL = rawmeta['configurationURL'] configurationversion = rawmeta['configurationversion'] @@ -450,7 +443,6 @@ class ConfigurationInfo extends GISJsonSerialised { LinkedHashMap serialisationdata() { def data = [ - 'format' : format, 'configurationname' : configurationname, 'configurationURL' : configurationURL, 'configurationversion' : configurationversion, @@ -532,12 +524,10 @@ class ChecksumSet extends GISJsonSerialised { } class ChecksumInfo extends GISJsonSerialised { - private String format private ArrayList checksumsets ChecksumInfo(script) { super(script) - this.format = '0.1' checksumsets = new ArrayList() } @@ -556,7 +546,6 @@ class ChecksumInfo extends GISJsonSerialised { } void deserialiseJson(rawmeta) { - //format = rawmeta['format'] checksumsets = new ArrayList() for (rawchecksumset in rawmeta['checksumsets']) { def cs = new ChecksumSet(script) @@ -567,7 +556,6 @@ class ChecksumInfo extends GISJsonSerialised { LinkedHashMap serialisationdata() { def data = [ - 'format' : format, 'checksumsets' : checksumsetsserialised(), ] return data From 19d7103f315d9ce1aa5348ddc907231dad6668c9 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Fri, 10 Dec 2021 18:20:14 +0000 Subject: [PATCH 028/182] Don't serialise associated meta data --- meta/folder.groovy | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/meta/folder.groovy b/meta/folder.groovy index 4efb0d2..fe8b565 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -593,12 +593,14 @@ class MetaInfo extends GISJsonSerialised { class RelatedMetaInfo extends GISJsonSerialised { private String format + private String fullpath private String offsetpath private MetaInfo meta - RelatedMetaInfo(script, offsetpath = "", MetaInfo meta = null) { + RelatedMetaInfo(script, fullpath = "", offsetpath = "", MetaInfo meta = null) { super(script) - this.format = '0.1' + this.format = '0.2' + this.fullpath = fullpath this.offsetpath = offsetpath this.meta = meta } @@ -614,7 +616,7 @@ class MetaInfo extends GISJsonSerialised { def data = [ 'format' : format, 'offsetpath' : offsetpath, - 'meta' : meta.serialisationdata(), + //'meta' : meta.serialisationdata(), ] return data } @@ -779,13 +781,14 @@ class MetaInfo extends GISJsonSerialised { def String adjustedpath = relativize(destpath) def importedmetafile = adjustedpath + "/" + metafilepath() if (script.fileExists(importedmetafile)) { + script.echo("Deserialising meta at file: ${importedmetafile} (destpath: ${destpath})") mi.deserialiseJson(importedmetafile) } else { script.echo("Could not deserialise meta at file: ${importedmetafile} (destpath: ${destpath})- Does not exist") mi.addConfigurationInfo('', givenRepo, givenRevision, givenSHA) } - RelatedMetaInfo rmi = new RelatedMetaInfo(script, adjustedpath, mi) + RelatedMetaInfo rmi = new RelatedMetaInfo(script, adjustedpath, adjustedpath, mi) if (appendtoparentmeta) { associatedmeta.add(rmi) } From dfcbbf1fa6fc9166754dedce9398c24867a9947f Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sat, 11 Dec 2021 16:02:22 +0000 Subject: [PATCH 029/182] Record the import path of meta data --- meta/folder.groovy | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/meta/folder.groovy b/meta/folder.groovy index fe8b565..d3b17c4 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -593,14 +593,14 @@ class MetaInfo extends GISJsonSerialised { class RelatedMetaInfo extends GISJsonSerialised { private String format - private String fullpath + private String importpath private String offsetpath private MetaInfo meta - RelatedMetaInfo(script, fullpath = "", offsetpath = "", MetaInfo meta = null) { + RelatedMetaInfo(script, importpath = "", offsetpath = "", MetaInfo meta = null) { super(script) this.format = '0.2' - this.fullpath = fullpath + this.importpath = importpath this.offsetpath = offsetpath this.meta = meta } @@ -788,7 +788,7 @@ class MetaInfo extends GISJsonSerialised { mi.addConfigurationInfo('', givenRepo, givenRevision, givenSHA) } - RelatedMetaInfo rmi = new RelatedMetaInfo(script, adjustedpath, adjustedpath, mi) + RelatedMetaInfo rmi = new RelatedMetaInfo(script, importedmetafile, adjustedpath, mi) if (appendtoparentmeta) { associatedmeta.add(rmi) } From f98f9e9565dc0d5e4e486b105c0903ebf9e10cc2 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sat, 11 Dec 2021 16:30:20 +0000 Subject: [PATCH 030/182] Relay input meta files to output meta folders --- artifacts/archiver.groovy | 3 ++- meta/folder.groovy | 12 ++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/artifacts/archiver.groovy b/artifacts/archiver.groovy index d7b69d0..0ac3a72 100644 --- a/artifacts/archiver.groovy +++ b/artifacts/archiver.groovy @@ -6,7 +6,8 @@ enum Store { this.JENKINS = Store.JENKINS this.ARTIFACTSERVER = Store.JENKINS -def archive(artifactlist, Store store = JENKINS ) { +def archive(meta, artifactlist, Store store = JENKINS ) { + meta.copyrelatedmeta() if (store == JENKINS) { archiveArtifacts(artifactlist) } diff --git a/meta/folder.groovy b/meta/folder.groovy index d3b17c4..d1cec10 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -795,6 +795,18 @@ class MetaInfo extends GISJsonSerialised { return mi } + + def copyrelatedmeta() { + for (relatedmetainfo in associatedmeta) { + def srcpath = "${relatedmetainfo.offsetpath}/${METAFOLDERNAME}" + def destpath = "${METAFOLDERNAME}/${relatedmetainfo.offsetpath}" + script.echo("Copying related meta folder: ${srcpath} to meta output folder: ${destpath} recursively") + fileOperations([ + folderCreateOperation(folderPath: destpath), + folderCopyOperation(sourceFolderPath: srcpath, destinationFolderPath: destpath) + ]) + } + } LinkedHashMap serialisationdata() { def data = [ From e466480d24574ba30159a5ccff0682e0fa99dcad Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sat, 11 Dec 2021 16:37:06 +0000 Subject: [PATCH 031/182] Relay input meta files to output meta folders --- artifacts/archiver.groovy | 1 + meta/folder.groovy | 1 + 2 files changed, 2 insertions(+) diff --git a/artifacts/archiver.groovy b/artifacts/archiver.groovy index 0ac3a72..5497106 100644 --- a/artifacts/archiver.groovy +++ b/artifacts/archiver.groovy @@ -7,6 +7,7 @@ this.JENKINS = Store.JENKINS this.ARTIFACTSERVER = Store.JENKINS def archive(meta, artifactlist, Store store = JENKINS ) { + echo "Archiving artifacts to store: ${store}" meta.copyrelatedmeta() if (store == JENKINS) { archiveArtifacts(artifactlist) diff --git a/meta/folder.groovy b/meta/folder.groovy index d1cec10..c0c3620 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -797,6 +797,7 @@ class MetaInfo extends GISJsonSerialised { } def copyrelatedmeta() { + script.echo("Copying related input meta data to output meta") for (relatedmetainfo in associatedmeta) { def srcpath = "${relatedmetainfo.offsetpath}/${METAFOLDERNAME}" def destpath = "${METAFOLDERNAME}/${relatedmetainfo.offsetpath}" From 450f38e6fe62e9e8928bbc81ddd4b9df74915958 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sat, 11 Dec 2021 16:58:20 +0000 Subject: [PATCH 032/182] Relay input meta files to output meta folders --- artifacts/archiver.groovy | 2 +- meta/folder.groovy | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/artifacts/archiver.groovy b/artifacts/archiver.groovy index 5497106..78bee55 100644 --- a/artifacts/archiver.groovy +++ b/artifacts/archiver.groovy @@ -10,7 +10,7 @@ def archive(meta, artifactlist, Store store = JENKINS ) { echo "Archiving artifacts to store: ${store}" meta.copyrelatedmeta() if (store == JENKINS) { - archiveArtifacts(artifactlist) + archiveArtifacts(artifacts: artifactlist) } } diff --git a/meta/folder.groovy b/meta/folder.groovy index c0c3620..efd48da 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -802,9 +802,9 @@ class MetaInfo extends GISJsonSerialised { def srcpath = "${relatedmetainfo.offsetpath}/${METAFOLDERNAME}" def destpath = "${METAFOLDERNAME}/${relatedmetainfo.offsetpath}" script.echo("Copying related meta folder: ${srcpath} to meta output folder: ${destpath} recursively") - fileOperations([ - folderCreateOperation(folderPath: destpath), - folderCopyOperation(sourceFolderPath: srcpath, destinationFolderPath: destpath) + script.fileOperations([ + script.folderCreateOperation(folderPath: destpath), + script.folderCopyOperation(sourceFolderPath: srcpath, destinationFolderPath: destpath) ]) } } From b397a0722b4ed9694e438edc9fdf789c8af158f4 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sat, 11 Dec 2021 19:52:11 +0000 Subject: [PATCH 033/182] Remove python checkout when it is not used --- packaging/debian.groovy | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/packaging/debian.groovy b/packaging/debian.groovy index c0a4dbb..4f779bf 100644 --- a/packaging/debian.groovy +++ b/packaging/debian.groovy @@ -64,14 +64,12 @@ def DebRootDefinition debDefinition(String rootpath, String packagesourceroot, S return new DebRootDefinition(rootpath, packagesourceroot, packageprefix, buildstamp, inpackagepathsuffix) } -def buildPackage(String packageout, String uniquepackageout, DebRootDefinition packagedefs, String password) { +def buildPackage(String packageout, String uniquepackageout, DebRootDefinition packagedefs) { try { sh """#!/bin/bash # Exit if any command fails set -xe - echo "${password}" | sudo -S echo - cp -v -r "${packagedefs.PACKAGE_SOURCE_ROOT}/${packagedefs.PACKAGE_SOURCE_FOLDER_NAME}"/* "${packagedefs.DEBPATH}" sudo chown -v -R root: "${packagedefs.DEBPATH}" @@ -97,8 +95,6 @@ def buildPackage(String packageout, String uniquepackageout, DebRootDefinition p catch (Exception e) { echo "Exception occurred" sh """#!/bin/bash -v - echo "${password}" | sudo -S echo - sudo chown -R ${USER}: "${packagedefs.DEBPATH}" exit 1 From 36b9f2e187f087b4a85c149b944d4ab3bced7e08 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sat, 11 Dec 2021 20:31:37 +0000 Subject: [PATCH 034/182] Use credential agent to supply password --- packaging/debian.groovy | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packaging/debian.groovy b/packaging/debian.groovy index 4f779bf..c0a4dbb 100644 --- a/packaging/debian.groovy +++ b/packaging/debian.groovy @@ -64,12 +64,14 @@ def DebRootDefinition debDefinition(String rootpath, String packagesourceroot, S return new DebRootDefinition(rootpath, packagesourceroot, packageprefix, buildstamp, inpackagepathsuffix) } -def buildPackage(String packageout, String uniquepackageout, DebRootDefinition packagedefs) { +def buildPackage(String packageout, String uniquepackageout, DebRootDefinition packagedefs, String password) { try { sh """#!/bin/bash # Exit if any command fails set -xe + echo "${password}" | sudo -S echo + cp -v -r "${packagedefs.PACKAGE_SOURCE_ROOT}/${packagedefs.PACKAGE_SOURCE_FOLDER_NAME}"/* "${packagedefs.DEBPATH}" sudo chown -v -R root: "${packagedefs.DEBPATH}" @@ -95,6 +97,8 @@ def buildPackage(String packageout, String uniquepackageout, DebRootDefinition p catch (Exception e) { echo "Exception occurred" sh """#!/bin/bash -v + echo "${password}" | sudo -S echo + sudo chown -R ${USER}: "${packagedefs.DEBPATH}" exit 1 From c7ff7598600835012ffec28f2bfebe46aa8ac518 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sat, 11 Dec 2021 20:58:52 +0000 Subject: [PATCH 035/182] Use credential agent to supply password --- meta/folder.groovy | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/meta/folder.groovy b/meta/folder.groovy index efd48da..5edde8f 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -608,8 +608,8 @@ class MetaInfo extends GISJsonSerialised { void deserialiseJson(rawmeta) { //format = rawmeta['format'] offsetpath = rawmeta['offsetpath'] - meta = new MetaInfo(script) - meta.deserialiseJson(rawmeta['meta']) + //meta = new MetaInfo(script) + //meta.deserialiseJson(rawmeta['meta']) } LinkedHashMap serialisationdata() { @@ -710,7 +710,7 @@ class MetaInfo extends GISJsonSerialised { } void deserialiseJson(rawmeta) { - if (rawmeta['format'] != '0.1') { + if (rawmeta['format'] != '0.1' ) { script.error("Unsupported meta format found at ${filepath}") return } From c39aac83b5125a3364d0af8de156b0e5ecf509ff Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sun, 12 Dec 2021 17:14:51 +0000 Subject: [PATCH 036/182] Use credential manager to perform sudo operations --- packaging/debian.groovy | 64 +++++++++++++++++++++-------------------- 1 file changed, 33 insertions(+), 31 deletions(-) diff --git a/packaging/debian.groovy b/packaging/debian.groovy index c0a4dbb..9f2f4d3 100644 --- a/packaging/debian.groovy +++ b/packaging/debian.groovy @@ -64,45 +64,47 @@ def DebRootDefinition debDefinition(String rootpath, String packagesourceroot, S return new DebRootDefinition(rootpath, packagesourceroot, packageprefix, buildstamp, inpackagepathsuffix) } -def buildPackage(String packageout, String uniquepackageout, DebRootDefinition packagedefs, String password) { - try { - sh """#!/bin/bash - # Exit if any command fails - set -xe +def buildPackage(String packageout, String uniquepackageout, DebRootDefinition packagedefs, String credentials_id) { + withCredentials([usernamePassword(credentialsId: credentials_id, + usernameVariable: 'SUDO_USERNAME', + passwordVariable: 'SUDO_PASSWORD')]) { + def sudo_S = "echo ${SUDO_PASSWORD} | sudo -S" + def sudo_Sk = "echo ${SUDO_PASSWORD} | sudo -S -k" + try { + sh """#!/bin/bash + # Exit if any command fails + set -xe - echo "${password}" | sudo -S echo + cp -v -r "${packagedefs.PACKAGE_SOURCE_ROOT}/${packagedefs.PACKAGE_SOURCE_FOLDER_NAME}"/* "${packagedefs.DEBPATH}" - cp -v -r "${packagedefs.PACKAGE_SOURCE_ROOT}/${packagedefs.PACKAGE_SOURCE_FOLDER_NAME}"/* "${packagedefs.DEBPATH}" + ${sudo_Sk} chown -v -R root: "${packagedefs.DEBPATH}" - sudo chown -v -R root: "${packagedefs.DEBPATH}" + mkdir -v -p "${packageout}" + echo "Building package:" + dpkg-deb -v --build "${packagedefs.DEBPATH}" "${packageout}/${packagedefs.PACKAGE_NAME}" - mkdir -v -p "${packageout}" - echo "Building package:" - dpkg-deb -v --build "${packagedefs.DEBPATH}" "${packageout}/${packagedefs.PACKAGE_NAME}" + mkdir -v -p "${uniquepackageout}" + cp "${packageout}/${packagedefs.PACKAGE_NAME}" "${uniquepackageout}/${packagedefs.UNIQUE_PACKAGE_NAME}" - mkdir -v -p "${uniquepackageout}" - cp "${packageout}/${packagedefs.PACKAGE_NAME}" "${uniquepackageout}/${packagedefs.UNIQUE_PACKAGE_NAME}" + echo "Showing package:" + dpkg-deb --show "${packageout}/${packagedefs.PACKAGE_NAME}" + echo "Showing package contents:" + dpkg-deb --contents "${packageout}/${packagedefs.PACKAGE_NAME}" - echo "Showing package:" - dpkg-deb --show "${packageout}/${packagedefs.PACKAGE_NAME}" - echo "Showing package contents:" - dpkg-deb --contents "${packageout}/${packagedefs.PACKAGE_NAME}" + echo "Showing package lintian output:" + lintian --suppress-tags dir-or-file-in-opt "${packageout}/${packagedefs.PACKAGE_NAME}" || true - echo "Showing package lintian output:" - lintian --suppress-tags dir-or-file-in-opt "${packageout}/${packagedefs.PACKAGE_NAME}" || true + ${sudo_Sk} chown -R ${USER}: "${packagedefs.DEBPATH}" + """ + } + catch (Exception e) { + echo "Exception occurred" + sh """#!/bin/bash -v + ${sudo_Sk} chown -R ${USER}: "${packagedefs.DEBPATH}" - sudo chown -R ${USER}: "${packagedefs.DEBPATH}" - """ - } - catch (Exception e) { - echo "Exception occurred" - sh """#!/bin/bash -v - echo "${password}" | sudo -S echo - - sudo chown -R ${USER}: "${packagedefs.DEBPATH}" - - exit 1 - """ + exit 1 + """ + } } } From 4132c4d470a21475f32a8e0d23a60236f00a4a6d Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Mon, 13 Dec 2021 22:56:07 +0000 Subject: [PATCH 037/182] Walk a tree of imported meta --- meta/folder.groovy | 37 ++++++++++++++++++++++++++++++++++--- 1 file changed, 34 insertions(+), 3 deletions(-) diff --git a/meta/folder.groovy b/meta/folder.groovy index 5edde8f..bf14e60 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -930,7 +930,36 @@ class MetaInfo extends GISJsonSerialised { return releasemetaversionuniquecollection } - def walkrelated(ArrayList metacollection, String comment = '', int level = 0) { + def openchildmeta(String gatheredpath, RelatedMetaInfo relatedmetainfo) { + MetaInfo mi = new MetaInfot(script) + + String nextpath + if (gatheredpath) { + nextpath = relatedmetainfo.offsetpath + } else { + nextpath = gatheredpath + '/' + relatedmetainfo.offsetpath + } + def importedmetafile = nextpath + '/' + METAFILENAME + def boolean next + if (script.fileExists(importedmetafile)) { + script.echo("Deserialising meta at file: ${importedmetafile}") + mi.deserialiseJson(importedmetafile) + next = true + } else { + script.echo("Could not deserialise meta at file: ${importedmetafile} - Does not exist") + next = false + } + + def childmetainfo = [ + next: next + nextpath: nextpath, + childmeta: mi + ] + + return childmetainfo + } + + def walkrelated(ArrayList metacollection, String comment = '', int level = 0, String gatheredpath = '') { def results = [ 'metacollection' : metacollection, 'comment': comment @@ -938,8 +967,10 @@ class MetaInfo extends GISJsonSerialised { results.metacollection.add(this) results.comment += "${level} ".padRight(level * 4) + globalreleasetag() + '\n' for (relatedmetainfo in associatedmeta) { - MetaInfo othermeta = relatedmetainfo.meta - results = othermeta.walkrelated(results.metacollection, results.comment, level + 1) + def childmetainfo = openchildmeta(gatheredpath, relatedmetainfo) + if (childmetainfo.next) { + results = childmetainfo.mi.walkrelated(results.metacollection, results.comment, level + 1, childmetainfo.nextpath) + } } return [ 'metacollection' : results.metacollection, 'comment': results.comment ] } From 71349d97bfcf42292051f505c5c8e26a8d748ce4 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Mon, 13 Dec 2021 22:58:22 +0000 Subject: [PATCH 038/182] Walk a tree of imported meta --- meta/folder.groovy | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/meta/folder.groovy b/meta/folder.groovy index bf14e60..a937d74 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -933,7 +933,7 @@ class MetaInfo extends GISJsonSerialised { def openchildmeta(String gatheredpath, RelatedMetaInfo relatedmetainfo) { MetaInfo mi = new MetaInfot(script) - String nextpath + def String nextpath if (gatheredpath) { nextpath = relatedmetainfo.offsetpath } else { @@ -951,9 +951,9 @@ class MetaInfo extends GISJsonSerialised { } def childmetainfo = [ - next: next - nextpath: nextpath, - childmeta: mi + 'next': next + 'nextpath': nextpath, + 'childmeta': mi ] return childmetainfo From a87cb8b649c88183a216c59933879b54c437e426 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Mon, 13 Dec 2021 22:59:06 +0000 Subject: [PATCH 039/182] Walk a tree of imported meta --- meta/folder.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta/folder.groovy b/meta/folder.groovy index a937d74..7d800cc 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -951,7 +951,7 @@ class MetaInfo extends GISJsonSerialised { } def childmetainfo = [ - 'next': next + 'next': next, 'nextpath': nextpath, 'childmeta': mi ] From 0d396e02853735141b646ab4e62d4b9e8f4e2d21 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Mon, 13 Dec 2021 22:59:50 +0000 Subject: [PATCH 040/182] Walk a tree of imported meta --- meta/folder.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta/folder.groovy b/meta/folder.groovy index 7d800cc..0473de6 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -931,7 +931,7 @@ class MetaInfo extends GISJsonSerialised { } def openchildmeta(String gatheredpath, RelatedMetaInfo relatedmetainfo) { - MetaInfo mi = new MetaInfot(script) + MetaInfo mi = new MetaInfo(script) def String nextpath if (gatheredpath) { From 3447179c59fa2a38594b907be633c57502b761ef Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Mon, 13 Dec 2021 23:06:28 +0000 Subject: [PATCH 041/182] Walk a tree of imported meta --- meta/folder.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta/folder.groovy b/meta/folder.groovy index 0473de6..6e4fd51 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -934,7 +934,7 @@ class MetaInfo extends GISJsonSerialised { MetaInfo mi = new MetaInfo(script) def String nextpath - if (gatheredpath) { + if (gatheredpath == '') { nextpath = relatedmetainfo.offsetpath } else { nextpath = gatheredpath + '/' + relatedmetainfo.offsetpath From 62005036425f2ed68057e73f872fcb4dc6a51e8d Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Mon, 13 Dec 2021 23:18:28 +0000 Subject: [PATCH 042/182] Walk a tree of imported meta --- meta/folder.groovy | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/meta/folder.groovy b/meta/folder.groovy index 6e4fd51..4ffb125 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -931,15 +931,17 @@ class MetaInfo extends GISJsonSerialised { } def openchildmeta(String gatheredpath, RelatedMetaInfo relatedmetainfo) { - MetaInfo mi = new MetaInfo(script) + def MetaInfo mi = new MetaInfo(script) def String nextpath + def importedmetafile if (gatheredpath == '') { nextpath = relatedmetainfo.offsetpath + importedmetafile = nextpath + '/' + metafilepath() } else { nextpath = gatheredpath + '/' + relatedmetainfo.offsetpath + importedmetafile = nextpath + '/' + METAFILENAME } - def importedmetafile = nextpath + '/' + METAFILENAME def boolean next if (script.fileExists(importedmetafile)) { script.echo("Deserialising meta at file: ${importedmetafile}") From 3b446d07bdf79015cb83321d7bb571653c47916c Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Mon, 13 Dec 2021 23:25:42 +0000 Subject: [PATCH 043/182] Walk a tree of imported meta --- meta/folder.groovy | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/meta/folder.groovy b/meta/folder.groovy index 4ffb125..a717654 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -942,21 +942,22 @@ class MetaInfo extends GISJsonSerialised { nextpath = gatheredpath + '/' + relatedmetainfo.offsetpath importedmetafile = nextpath + '/' + METAFILENAME } - def boolean next + def boolean imported if (script.fileExists(importedmetafile)) { script.echo("Deserialising meta at file: ${importedmetafile}") mi.deserialiseJson(importedmetafile) - next = true + imported = true } else { script.echo("Could not deserialise meta at file: ${importedmetafile} - Does not exist") - next = false + imported = false } def childmetainfo = [ - 'next': next, + 'imported': imported, 'nextpath': nextpath, 'childmeta': mi ] + script.echo("Child meta results: ${childmetainfo}") return childmetainfo } From 84c313a8b1842b1ec9c9f906a14bf545ddbd7963 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Mon, 13 Dec 2021 23:29:26 +0000 Subject: [PATCH 044/182] Walk a tree of imported meta --- meta/folder.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta/folder.groovy b/meta/folder.groovy index a717654..a4f27c4 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -971,7 +971,7 @@ class MetaInfo extends GISJsonSerialised { results.comment += "${level} ".padRight(level * 4) + globalreleasetag() + '\n' for (relatedmetainfo in associatedmeta) { def childmetainfo = openchildmeta(gatheredpath, relatedmetainfo) - if (childmetainfo.next) { + if (childmetainfo.imported) { results = childmetainfo.mi.walkrelated(results.metacollection, results.comment, level + 1, childmetainfo.nextpath) } } From 04d17c1b683d4822ab2a6adce9c646c86379d6f9 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Mon, 13 Dec 2021 23:40:03 +0000 Subject: [PATCH 045/182] Walk a tree of imported meta --- meta/folder.groovy | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meta/folder.groovy b/meta/folder.groovy index a4f27c4..38ecdff 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -957,8 +957,6 @@ class MetaInfo extends GISJsonSerialised { 'nextpath': nextpath, 'childmeta': mi ] - script.echo("Child meta results: ${childmetainfo}") - return childmetainfo } @@ -969,8 +967,10 @@ class MetaInfo extends GISJsonSerialised { ] results.metacollection.add(this) results.comment += "${level} ".padRight(level * 4) + globalreleasetag() + '\n' + script.echo("Partial results: ${results.comment}") for (relatedmetainfo in associatedmeta) { def childmetainfo = openchildmeta(gatheredpath, relatedmetainfo) + script.echo("Child meta results: ${childmetainfo}") if (childmetainfo.imported) { results = childmetainfo.mi.walkrelated(results.metacollection, results.comment, level + 1, childmetainfo.nextpath) } From af5f19b4ef0fad336b758d923ccc2d5ec2166950 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 14 Dec 2021 09:11:19 +0000 Subject: [PATCH 046/182] Walk a tree of imported meta --- meta/folder.groovy | 1 + 1 file changed, 1 insertion(+) diff --git a/meta/folder.groovy b/meta/folder.groovy index 38ecdff..c2caaa1 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -961,6 +961,7 @@ class MetaInfo extends GISJsonSerialised { } def walkrelated(ArrayList metacollection, String comment = '', int level = 0, String gatheredpath = '') { + script.echo("walkrelated: metacollection: ${metacollection}\nComment: ${comment}\nLevel: ${level}\nGathered path: ${gatheredpath}") def results = [ 'metacollection' : metacollection, 'comment': comment From 035977333b644c62082af72c5d1c06c0e7102411 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 14 Dec 2021 09:16:02 +0000 Subject: [PATCH 047/182] Walk a tree of imported meta --- meta/folder.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta/folder.groovy b/meta/folder.groovy index c2caaa1..7a6ba4e 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -973,7 +973,7 @@ class MetaInfo extends GISJsonSerialised { def childmetainfo = openchildmeta(gatheredpath, relatedmetainfo) script.echo("Child meta results: ${childmetainfo}") if (childmetainfo.imported) { - results = childmetainfo.mi.walkrelated(results.metacollection, results.comment, level + 1, childmetainfo.nextpath) + results = childmetainfo.childmeta.walkrelated(results.metacollection, results.comment, level + 1, childmetainfo.nextpath) } } return [ 'metacollection' : results.metacollection, 'comment': results.comment ] From 6bf8b5886c912526f7db8f09e13183cd4094afe9 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 14 Dec 2021 09:43:38 +0000 Subject: [PATCH 048/182] Walk a tree of imported meta --- meta/folder.groovy | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/meta/folder.groovy b/meta/folder.groovy index 7a6ba4e..71514fb 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -934,17 +934,14 @@ class MetaInfo extends GISJsonSerialised { def MetaInfo mi = new MetaInfo(script) def String nextpath - def importedmetafile if (gatheredpath == '') { - nextpath = relatedmetainfo.offsetpath - importedmetafile = nextpath + '/' + metafilepath() + nextpath = "${relatedmetainfo.offsetpath}/${METAFOLDERNAME}" } else { - nextpath = gatheredpath + '/' + relatedmetainfo.offsetpath - importedmetafile = nextpath + '/' + METAFILENAME + nextpath = "${gatheredpath}/${relatedmetainfo.offsetpath}" } + def importedmetafile = "${nextpath}/${METAFILENAME}" def boolean imported if (script.fileExists(importedmetafile)) { - script.echo("Deserialising meta at file: ${importedmetafile}") mi.deserialiseJson(importedmetafile) imported = true } else { From a64688112a8a5690a2bebc281bc3957e8b0ff5d8 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 14 Dec 2021 12:02:01 +0000 Subject: [PATCH 049/182] Remove debug; RelatedMetaInfo does not store meta info anymore --- meta/folder.groovy | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/meta/folder.groovy b/meta/folder.groovy index 71514fb..045c866 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -595,28 +595,23 @@ class MetaInfo extends GISJsonSerialised { private String format private String importpath private String offsetpath - private MetaInfo meta - - RelatedMetaInfo(script, importpath = "", offsetpath = "", MetaInfo meta = null) { + + RelatedMetaInfo(script, importpath = "", offsetpath = "") { super(script) this.format = '0.2' this.importpath = importpath this.offsetpath = offsetpath - this.meta = meta } void deserialiseJson(rawmeta) { //format = rawmeta['format'] offsetpath = rawmeta['offsetpath'] - //meta = new MetaInfo(script) - //meta.deserialiseJson(rawmeta['meta']) } LinkedHashMap serialisationdata() { def data = [ 'format' : format, 'offsetpath' : offsetpath, - //'meta' : meta.serialisationdata(), ] return data } @@ -788,7 +783,7 @@ class MetaInfo extends GISJsonSerialised { mi.addConfigurationInfo('', givenRepo, givenRevision, givenSHA) } - RelatedMetaInfo rmi = new RelatedMetaInfo(script, importedmetafile, adjustedpath, mi) + RelatedMetaInfo rmi = new RelatedMetaInfo(script, importedmetafile, adjustedpath) if (appendtoparentmeta) { associatedmeta.add(rmi) } @@ -958,17 +953,14 @@ class MetaInfo extends GISJsonSerialised { } def walkrelated(ArrayList metacollection, String comment = '', int level = 0, String gatheredpath = '') { - script.echo("walkrelated: metacollection: ${metacollection}\nComment: ${comment}\nLevel: ${level}\nGathered path: ${gatheredpath}") def results = [ 'metacollection' : metacollection, 'comment': comment ] results.metacollection.add(this) results.comment += "${level} ".padRight(level * 4) + globalreleasetag() + '\n' - script.echo("Partial results: ${results.comment}") for (relatedmetainfo in associatedmeta) { def childmetainfo = openchildmeta(gatheredpath, relatedmetainfo) - script.echo("Child meta results: ${childmetainfo}") if (childmetainfo.imported) { results = childmetainfo.childmeta.walkrelated(results.metacollection, results.comment, level + 1, childmetainfo.nextpath) } From 2ba37172e4138a643a9f95975f11f15a37a6d225 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 14 Dec 2021 13:54:14 +0000 Subject: [PATCH 050/182] Handle v0.1 and v0.2 formats simultaneously --- meta/folder.groovy | 91 +++++++++++++++++++++++++++++++++++++++------- 1 file changed, 78 insertions(+), 13 deletions(-) diff --git a/meta/folder.groovy b/meta/folder.groovy index 045c866..4f4cb52 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -590,15 +590,52 @@ class MetaInfo extends GISJsonSerialised { private static String METAFOLDERNAME = 'meta' private static String METAFILENAME = 'info.json' private static String METAARTIFACTS = "${METAFOLDERNAME}/**" + private static String format = '0.2' - class RelatedMetaInfo extends GISJsonSerialised { + trait RelatedMetaInfo extends GISJsonSerialised { private String format + + RelatedMetaInfo(script, format) { + super(script) + this.format = format + } + + abstract void deserialiseJson(rawmeta) + abstract LinkedHashMap serialisationdata() + } + + class RelatedMetaInfo_v0_1 extends RelatedMetaInfo { + String offsetpath + MetaInfo meta + + RelatedMetaInfo_v0_1(script, offsetpath = "", MetaInfo meta = null) { + super(script, '0.1') + this.offsetpath = offsetpath + this.meta = meta + } + + void deserialiseJson(rawmeta) { + offsetpath = rawmeta['offsetpath'] + meta = new MetaInfo(script) + meta.deserialiseJson(rawmeta['meta']) + } + + LinkedHashMap serialisationdata() { + def data = [ + 'format' : format, + 'offsetpath' : offsetpath, + 'meta' : meta.serialisationdata(), + ] + return data + } + } + + class RelatedMetaInfo_v0_2 extends RelatedMetaInfo { private String importpath private String offsetpath - RelatedMetaInfo(script, importpath = "", offsetpath = "") { - super(script) - this.format = '0.2' + RelatedMetaInfo_v0_2(script, importpath = "", offsetpath = "") { + super(script, '0.2') this.importpath = importpath this.offsetpath = offsetpath } @@ -617,7 +654,6 @@ class MetaInfo extends GISJsonSerialised { } } - private String format = '0.1' private ProductInfo productinfo private GitInfo gitinfo private JenkinsBuildInfo jenkinsbuildinfo @@ -705,7 +741,7 @@ class MetaInfo extends GISJsonSerialised { } void deserialiseJson(rawmeta) { - if (rawmeta['format'] != '0.1' ) { + if (rawmeta['format'] != '0.1' || rawmeta['format'] != '0.2' ) { script.error("Unsupported meta format found at ${filepath}") return } @@ -727,9 +763,15 @@ class MetaInfo extends GISJsonSerialised { } custominfo = rawmeta['custominfo'] for (rawrelatedmeta in rawmeta['associatedmeta']) { - def rm = new RelatedMetaInfo(script) - rm.deserialiseJson(rawrelatedmeta) - associatedmeta.add(rm) + if (rawrelatedmeta['format'] == nul || rawrelatedmeta['format'] == '0.1') { + def rm = new RelatedMetaInfo_v0_1(script) + rm.deserialiseJson(rawrelatedmeta) + associatedmeta.add(rm) + } else if (rawrelatedmeta['format'] == '0.2') { + def rm = new RelatedMetaInfo_v0_2(script) + rm.deserialiseJson(rawrelatedmeta) + associatedmeta.add(rm) + } } } @@ -783,7 +825,7 @@ class MetaInfo extends GISJsonSerialised { mi.addConfigurationInfo('', givenRepo, givenRevision, givenSHA) } - RelatedMetaInfo rmi = new RelatedMetaInfo(script, importedmetafile, adjustedpath) + RelatedMetaInfo rmi = new RelatedMetaInfo_v0_2(script, importedmetafile, adjustedpath) if (appendtoparentmeta) { associatedmeta.add(rmi) } @@ -952,6 +994,24 @@ class MetaInfo extends GISJsonSerialised { return childmetainfo } + def walkrelated_v0_1(ArrayList metacollection, String comment = '', int level = 0) { + def results = [ + 'metacollection' : metacollection, + 'comment': comment + ] + results.metacollection.add(this) + results.comment += "${level} ".padRight(level * 4) + globalreleasetag() + '\n' + for (relatedmetainfo in associatedmeta) { + if (!relatedmetainfo.format || relatedmetainfo.format == '0.1') { + def MetaInfo othermeta = relatedmetainfo.meta + results = othermeta.walkrelated_v0_1(results.metacollection, results.comment, level + 1) + } else { + script.error("There is non v0.1 format related meta info under v0.1 related meta info") + } + } + return [ 'metacollection' : results.metacollection, 'comment': results.comment ] + } + def walkrelated(ArrayList metacollection, String comment = '', int level = 0, String gatheredpath = '') { def results = [ 'metacollection' : metacollection, @@ -960,9 +1020,14 @@ class MetaInfo extends GISJsonSerialised { results.metacollection.add(this) results.comment += "${level} ".padRight(level * 4) + globalreleasetag() + '\n' for (relatedmetainfo in associatedmeta) { - def childmetainfo = openchildmeta(gatheredpath, relatedmetainfo) - if (childmetainfo.imported) { - results = childmetainfo.childmeta.walkrelated(results.metacollection, results.comment, level + 1, childmetainfo.nextpath) + if (relatedmetainfo.format == '0.2') { + def childmetainfo = openchildmeta(gatheredpath, relatedmetainfo) + if (childmetainfo.imported) { + results = childmetainfo.childmeta.walkrelated(results.metacollection, results.comment, level + 1, childmetainfo.nextpath) + } + } else if (relatedmetainfo.format == '0.1') { + def MetaInfo othermeta = relatedmetainfo.meta + results = othermeta.walkrelated_v0_1(results.metacollection, results.comment, level + 1) } } return [ 'metacollection' : results.metacollection, 'comment': results.comment ] From f31914d43b355effb283763335302a9628688ca6 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 14 Dec 2021 14:10:28 +0000 Subject: [PATCH 051/182] Make sure all jobs are using the new archiver --- copy/esw.groovy | 2 +- copy/filtered.groovy | 2 +- copy/logic.groovy | 2 +- staticanalysis/cpd.groovy | 2 +- staticanalysis/cppcheck.groovy | 2 +- test/testethernetproduct.groovy | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/copy/esw.groovy b/copy/esw.groovy index 6ccb53e..5d9af25 100644 --- a/copy/esw.groovy +++ b/copy/esw.groovy @@ -42,7 +42,7 @@ pipeline { mv -v "${ESW}"/* . """ artifactarchiver = load("${autobuilder.commonscripts()}/artifacts/archiver.groovy") - artifactarchiver.archive(artifactlist) + artifactarchiver.archive(meta, artifactlist) } } } diff --git a/copy/filtered.groovy b/copy/filtered.groovy index 251de93..555ce8d 100644 --- a/copy/filtered.groovy +++ b/copy/filtered.groovy @@ -49,7 +49,7 @@ pipeline { script { def artifactlist = meta.generateartifacts(["filtered/**"]) artifactarchiver = load("${autobuilder.commonscripts()}/artifacts/archiver.groovy") - artifactarchiver.archive(artifactlist) + artifactarchiver.archive(meta, artifactlist) } } } diff --git a/copy/logic.groovy b/copy/logic.groovy index 7b20935..0a28a22 100644 --- a/copy/logic.groovy +++ b/copy/logic.groovy @@ -44,7 +44,7 @@ pipeline { mv -v "logic"/* . """ artifactarchiver = load("${autobuilder.commonscripts()}/artifacts/archiver.groovy") - artifactarchiver.archive(artifactlist) + artifactarchiver.archive(meta, artifactlist) } } } diff --git a/staticanalysis/cpd.groovy b/staticanalysis/cpd.groovy index f9ddfcb..c04649c 100644 --- a/staticanalysis/cpd.groovy +++ b/staticanalysis/cpd.groovy @@ -130,7 +130,7 @@ pipeline { ArrayList itemsForRelease = ["${STATICANALYSIS}/**"] def artifactlist = meta.generateartifacts(itemsForRelease) artifactarchiver = load("${autobuilder.commonscripts()}/artifacts/archiver.groovy") - artifactarchiver.archive(artifactlist) + artifactarchiver.archive(meta, artifactlist) } } } diff --git a/staticanalysis/cppcheck.groovy b/staticanalysis/cppcheck.groovy index 696f11d..d959770 100644 --- a/staticanalysis/cppcheck.groovy +++ b/staticanalysis/cppcheck.groovy @@ -92,7 +92,7 @@ pipeline { ArrayList itemsForRelease = ["${STATICANALYSIS}/**"] def artifactlist = meta.generateartifacts(itemsForRelease) artifactarchiver = load("${autobuilder.commonscripts()}/artifacts/archiver.groovy") - artifactarchiver.archive(artifactlist) + artifactarchiver.archive(meta, artifactlist) } } } diff --git a/test/testethernetproduct.groovy b/test/testethernetproduct.groovy index f45cf19..5e2ce53 100644 --- a/test/testethernetproduct.groovy +++ b/test/testethernetproduct.groovy @@ -193,7 +193,7 @@ pipeline { script { def artifactlist = meta.generateartifacts([ "${LOGGING_ROOT}/**"]) artifactarchiver = load("${autobuilder.commonscripts()}/artifacts/archiver.groovy") - artifactarchiver.archive(artifactlist) + artifactarchiver.archive(meta, artifactlist) } } } From 9e0fe09f0efc16bfb4be0a8e70282aa897f41757 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 14 Dec 2021 15:15:58 +0000 Subject: [PATCH 052/182] Make sure all jobs are using the new archiver --- meta/folder.groovy | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/meta/folder.groovy b/meta/folder.groovy index 4f4cb52..cd5fe35 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -592,7 +592,13 @@ class MetaInfo extends GISJsonSerialised { private static String METAARTIFACTS = "${METAFOLDERNAME}/**" private static String format = '0.2' - trait RelatedMetaInfo extends GISJsonSerialised { + interface IRelatedMetaInfo { + abstract void deserialiseJson(rawmeta) + abstract LinkedHashMap serialisationdata() + abstract String format() + } + + class RelatedMetaInfo extends GISJsonSerialised implements IRelatedMetaInfo { private String format RelatedMetaInfo(script, format) { @@ -602,6 +608,10 @@ class MetaInfo extends GISJsonSerialised { abstract void deserialiseJson(rawmeta) abstract LinkedHashMap serialisationdata() + + String format() { + return format + } } class RelatedMetaInfo_v0_1 extends RelatedMetaInfo { From 0406350f78410b11eb7041b2406f55e1c473cdec Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 14 Dec 2021 15:19:35 +0000 Subject: [PATCH 053/182] Make sure all jobs are using the new archiver --- meta/folder.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta/folder.groovy b/meta/folder.groovy index cd5fe35..4262a1c 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -598,7 +598,7 @@ class MetaInfo extends GISJsonSerialised { abstract String format() } - class RelatedMetaInfo extends GISJsonSerialised implements IRelatedMetaInfo { + abstract class RelatedMetaInfo extends GISJsonSerialised implements IRelatedMetaInfo { private String format RelatedMetaInfo(script, format) { From 6502cf749245ed689c1d3366a205e2d3bdbe4d3a Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 14 Dec 2021 15:25:32 +0000 Subject: [PATCH 054/182] Make sure all jobs are using the new archiver --- meta/folder.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta/folder.groovy b/meta/folder.groovy index 4262a1c..1b409ff 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -898,7 +898,7 @@ class MetaInfo extends GISJsonSerialised { private ArrayList releasewalkerp(int maxdepth, ArrayList releasemetacollection, String pathsofar) { if (maxdepth > 0) { if (releaseinfo.releaserepoURL) { - RelatedMetaInfo rmi = new RelatedMetaInfo(script, pathsofar, this) + RelatedMetaInfo rmi = new RelatedMetaInfo_v0_1(script, pathsofar, this) releasemetacollection.add(rmi) } if (pathsofar) { From e57708a515daa4840eb46156102fc71f8aa7cb88 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 14 Dec 2021 15:44:01 +0000 Subject: [PATCH 055/182] Make sure all jobs are using the new archiver --- meta/folder.groovy | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/meta/folder.groovy b/meta/folder.groovy index 1b409ff..143d29b 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -751,8 +751,9 @@ class MetaInfo extends GISJsonSerialised { } void deserialiseJson(rawmeta) { + script.echo("Format: ${rawmeta['format']}") if (rawmeta['format'] != '0.1' || rawmeta['format'] != '0.2' ) { - script.error("Unsupported meta format found at ${filepath}") + script.error("Unsupported meta format found") return } productinfo.deserialiseJson(rawmeta['productinfo']) From e9157c3b63e2cf10ca99e12d78602c1207dce3c1 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 14 Dec 2021 15:48:35 +0000 Subject: [PATCH 056/182] Make sure all jobs are using the new archiver --- meta/folder.groovy | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meta/folder.groovy b/meta/folder.groovy index 143d29b..2651e70 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -751,8 +751,8 @@ class MetaInfo extends GISJsonSerialised { } void deserialiseJson(rawmeta) { - script.echo("Format: ${rawmeta['format']}") - if (rawmeta['format'] != '0.1' || rawmeta['format'] != '0.2' ) { + script.echo("Format: ${rawmeta['format']} ${rawmeta['format'].getClass()}") + if (rawmeta['format'].toString() != '0.1' || rawmeta['format'].toString() != '0.2' ) { script.error("Unsupported meta format found") return } From 149e1fd8f4e2fdb41535f9d3203dc6102b9c3184 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 14 Dec 2021 16:01:30 +0000 Subject: [PATCH 057/182] Make sure all jobs are using the new archiver --- meta/folder.groovy | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/meta/folder.groovy b/meta/folder.groovy index 2651e70..ad88d7c 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -751,8 +751,7 @@ class MetaInfo extends GISJsonSerialised { } void deserialiseJson(rawmeta) { - script.echo("Format: ${rawmeta['format']} ${rawmeta['format'].getClass()}") - if (rawmeta['format'].toString() != '0.1' || rawmeta['format'].toString() != '0.2' ) { + if (rawmeta['format'].toString() != '0.1' && rawmeta['format'].toString() != '0.2' ) { script.error("Unsupported meta format found") return } From 523407f68fa9dcba0f2813f62471eb2c79f51ba2 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 14 Dec 2021 16:04:59 +0000 Subject: [PATCH 058/182] Make sure all jobs are using the new archiver --- meta/folder.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta/folder.groovy b/meta/folder.groovy index ad88d7c..dd3a1b7 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -773,7 +773,7 @@ class MetaInfo extends GISJsonSerialised { } custominfo = rawmeta['custominfo'] for (rawrelatedmeta in rawmeta['associatedmeta']) { - if (rawrelatedmeta['format'] == nul || rawrelatedmeta['format'] == '0.1') { + if (!rawrelatedmeta['format'] || rawrelatedmeta['format'] == '0.1') { def rm = new RelatedMetaInfo_v0_1(script) rm.deserialiseJson(rawrelatedmeta) associatedmeta.add(rm) From c985dcb55234f492d5b945d85c791656815745a0 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 14 Dec 2021 17:20:28 +0000 Subject: [PATCH 059/182] Use non-deprecated methods for importing --- artifacts/metaexport.groovy | 7 ++++++- copy/esw.groovy | 5 ++++- copy/filtered.groovy | 4 +++- differences/metahierarchy.groovy | 14 ++++++++++++-- publish/package.groovy | 7 ++++++- 5 files changed, 31 insertions(+), 6 deletions(-) diff --git a/artifacts/metaexport.groovy b/artifacts/metaexport.groovy index 4d93cc5..8e5e56e 100644 --- a/artifacts/metaexport.groovy +++ b/artifacts/metaexport.groovy @@ -11,7 +11,12 @@ def combineSubjobArtifacts(meta, importer, subJobs) { dir(destFolder) { deleteDir() } - importer.artifactimport(meta, subJobName, subJobNumber, destFolder, incrementversionnumber) + + def importoptions = importer.getNewImportOptions() + importoptions.jenkinsjob(subJobName, subJobNumber) + importoptions.setincrementversionnumber(incrementversionnumber) + importer.artifactimport(meta, importoptions, destFolder) + artifactFolders.add("${destFolder}/**") } } diff --git a/copy/esw.groovy b/copy/esw.groovy index 5d9af25..b9eb737 100644 --- a/copy/esw.groovy +++ b/copy/esw.groovy @@ -28,7 +28,10 @@ pipeline { stage('Copying embedded software artifacts') { steps { script { - importer.artifactimport(meta, ESW_ARTIFACT_LOCATION, ESW_ARTIFACT_BUILD_JOB, ESW_ARTIFACT_BUILD_SELECTOR, ESW_ARTIFACT_RELEASE_REPO, ESW_ARTIFACT_RELEASE_REVISION, ESWDEST) + def eswimportoptions = importer.getNewImportOptions() + eswimportoptions.source(ESW_ARTIFACT_LOCATION, ESW_ARTIFACT_BUILD_JOB, ESW_ARTIFACT_BUILD_SELECTOR, ESW_ARTIFACT_RELEASE_REPO, ESW_ARTIFACT_RELEASE_REVISION) + eswimportoptions.setincrementversionnumber(true) + importer.artifactimport(meta, eswimportoptions, ESWDEST) } } } diff --git a/copy/filtered.groovy b/copy/filtered.groovy index 555ce8d..3ad24cd 100644 --- a/copy/filtered.groovy +++ b/copy/filtered.groovy @@ -27,7 +27,9 @@ pipeline { stage('Import artifacts') { steps { script { - importer.artifactimport(meta, ARTIFACT_LOCATION, ARTIFACT_PROJECT, ARTIFACT_BUILD_SELECTOR, RELEASE_REPO, RELEASE_REVISION, IMPORT) + def importoptions = importer.getNewImportOptions() + importoptions.source(ARTIFACT_LOCATION, ARTIFACT_PROJECT, ARTIFACT_BUILD_SELECTOR, RELEASE_REPO, RELEASE_REVISION) + importer.artifactimport(meta, importoptions, IMPORT) } } } diff --git a/differences/metahierarchy.groovy b/differences/metahierarchy.groovy index 60d9835..01c1890 100644 --- a/differences/metahierarchy.groovy +++ b/differences/metahierarchy.groovy @@ -37,8 +37,18 @@ pipeline { importer = load("${autobuilder.commonscripts()}/import/importer.groovy") SOURCEURL = TOP_LEVEL_META_REPOSITORY.trim() - importer.artifactimport(meta, EARLY_SOURCE, EARLY_BUILD_JOB, EARLY_BUILD_SELECTOR, SOURCEURL, RELEASE_EARLY_REVISION, EARLYROOTDIR, false, 'meta/**') - importer.artifactimport(meta, LATER_SOURCE, LATER_BUILD_JOB, LATER_BUILD_SELECTOR, SOURCEURL, RELEASE_LATER_REVISION, LATERROOTDIR, false, 'meta/**') + + def earlyimportoptions = importer.getNewImportOptions() + earlyimportoptions.source(EARLY_SOURCE, EARLY_BUILD_JOB, EARLY_BUILD_SELECTOR, SOURCEURL, RELEASE_EARLY_REVISION) + earlyimportoptions.setincrementversionnumber(false) + earlyimportoptions.setfilter('meta/**') + importer.artifactimport(meta, earlyimportoptions, EARLYROOTDIR) + + def laterimportoptions = importer.getNewImportOptions() + laterimportoptions.source(LATER_SOURCE, LATER_BUILD_JOB, LATER_BUILD_SELECTOR, SOURCEURL, RELEASE_LATER_REVISION) + laterimportoptions.setincrementversionnumber(false) + laterimportoptions.setfilter('meta/**') + importer.artifactimport(meta, laterimportoptions, LATERROOTDIR) } } } diff --git a/publish/package.groovy b/publish/package.groovy index 958a614..68c41f3 100644 --- a/publish/package.groovy +++ b/publish/package.groovy @@ -48,7 +48,12 @@ pipeline { steps { script { importer = load("${autobuilder.commonscripts()}/import/importer.groovy") - packagemeta = importer.artifactimport(meta, PACKAGE_CREATE_JOB, PACKAGE_CREATE_JOB_SELECTOR, PACKAGEDEST) + + def packageimportoptions = importer.getNewImportOptions() + packageimportoptions.jenkinsjob(PACKAGE_CREATE_JOB, PACKAGE_CREATE_JOB_SELECTOR) + packageimportoptions.setincrementversionnumber(true) + packagemeta = importer.artifactimport(meta, packageimportoptions, PACKAGEDEST) + PACKAGE_FOLDER = "${PACKAGEDEST}/package" UNIQUE_PACKAGE_FOLDER = "${PACKAGEDEST}/uniquepackage" } From 9b2752021245f9a3cfdfbc531eab2176d891240d Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 14 Dec 2021 21:59:26 +0000 Subject: [PATCH 060/182] Make all walkers use a walker that understand v0.1 and v0.2 formats --- meta/folder.groovy | 137 ++++++++++++++++++--------------------------- 1 file changed, 54 insertions(+), 83 deletions(-) diff --git a/meta/folder.groovy b/meta/folder.groovy index dd3a1b7..adf124a 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -893,31 +893,6 @@ class MetaInfo extends GISJsonSerialised { saveJsonSerialised(metafilepath) return artifactlist } - - // Recurse tree of meta looking for release info and accumulate path - Pass by reference unavailable in Groovy/Java - private ArrayList releasewalkerp(int maxdepth, ArrayList releasemetacollection, String pathsofar) { - if (maxdepth > 0) { - if (releaseinfo.releaserepoURL) { - RelatedMetaInfo rmi = new RelatedMetaInfo_v0_1(script, pathsofar, this) - releasemetacollection.add(rmi) - } - if (pathsofar) { - pathsofar += "/" - } - for (relatedmetainfo in associatedmeta) { - MetaInfo othermeta = relatedmetainfo.meta - String newpathsofar = pathsofar + relatedmetainfo.offsetpath - releasemetacollection = othermeta.releasewalkerp(maxdepth - 1, releasemetacollection, newpathsofar) - } - } - return releasemetacollection - } - - ArrayList releasewalker(int maxdepth, String startpath = "") { - ArrayList releasemetacollection = new ArrayList() - releasemetacollection = releasewalkerp(maxdepth, releasemetacollection, startpath) - return releasemetacollection - } String componentidentifier() { return productinfo.productname + "_" + productinfo.subcomponentname @@ -939,44 +914,6 @@ class MetaInfo extends GISJsonSerialised { return buildstampinfo.buildstamp + "-" + jenkinsbuildinfo.buildnumber } - Map putwithshortestoffsetpath(Map releasemetacollection, String uniquestring, RelatedMetaInfo relatedmetainfo) { - if (releasemetacollection.containsKey(uniquestring)) { - def existingentry = releasemetacollection[uniquestring] - if (existingentry.offsetpath.size() > relatedmetainfo.offsetpath.size()) { - releasemetacollection.put(uniquestring, relatedmetainfo) - } - } else { - releasemetacollection.put(uniquestring, relatedmetainfo) - } - return releasemetacollection - } - - Map releasewalkerunique(int maxdepth, String startpath = "") { - def ArrayList releasemetacollection = new ArrayList() - releasemetacollection = releasewalkerp(maxdepth, releasemetacollection, startpath) - - def Map releasemetauniquecollection = new LinkedHashMap() - for (relatedmetainfo in releasemetacollection) { - def String uniquestring = relatedmetainfo.meta.componentidentifier() - releasemetauniquecollection = putwithshortestoffsetpath(releasemetauniquecollection, uniquestring, relatedmetainfo) - } - - return releasemetauniquecollection - } - - Map releasewalkerversionunique(int maxdepth, String startpath = "") { - ArrayList releasemetacollection = new ArrayList() - releasemetacollection = releasewalkerp(maxdepth, releasemetacollection, startpath) - - def Map releasemetaversionuniquecollection = new LinkedHashMap() - for (relatedmetainfo in releasemetacollection) { - def String uniquestring = relatedmetainfo.meta.componentversionuniqueidentifier() - releasemetaversionuniquecollection = putwithshortestoffsetpath(releasemetaversionuniquecollection, uniquestring, relatedmetainfo) - } - - return releasemetaversionuniquecollection - } - def openchildmeta(String gatheredpath, RelatedMetaInfo relatedmetainfo) { def MetaInfo mi = new MetaInfo(script) @@ -1004,40 +941,44 @@ class MetaInfo extends GISJsonSerialised { return childmetainfo } - def walkrelated_v0_1(ArrayList metacollection, String comment = '', int level = 0) { + def walkrelated_v0_1(ArrayList metacollection, String comment = '', int level = 0, boolean limiteddepth = false, int maxdepth = 0) { def results = [ 'metacollection' : metacollection, 'comment': comment ] - results.metacollection.add(this) - results.comment += "${level} ".padRight(level * 4) + globalreleasetag() + '\n' - for (relatedmetainfo in associatedmeta) { - if (!relatedmetainfo.format || relatedmetainfo.format == '0.1') { - def MetaInfo othermeta = relatedmetainfo.meta - results = othermeta.walkrelated_v0_1(results.metacollection, results.comment, level + 1) - } else { - script.error("There is non v0.1 format related meta info under v0.1 related meta info") + if (!limiteddepth || maxdepth > 0) { + results.metacollection.add(this) + results.comment += "${level} ".padRight(level * 4) + globalreleasetag() + '\n' + for (relatedmetainfo in associatedmeta) { + if (!relatedmetainfo.format || relatedmetainfo.format == '0.1') { + def MetaInfo othermeta = relatedmetainfo.meta + results = othermeta.walkrelated_v0_1(results.metacollection, results.comment, level + 1, limiteddepth, maxdepth - 1) + } else { + script.error("There is non v0.1 format related meta info under v0.1 related meta info") + } } } return [ 'metacollection' : results.metacollection, 'comment': results.comment ] } - def walkrelated(ArrayList metacollection, String comment = '', int level = 0, String gatheredpath = '') { + def walkrelated(ArrayList metacollection, String comment = '', int level = 0, String gatheredpath = '', boolean limiteddepth = false, int maxdepth = 0) { def results = [ 'metacollection' : metacollection, 'comment': comment ] - results.metacollection.add(this) - results.comment += "${level} ".padRight(level * 4) + globalreleasetag() + '\n' - for (relatedmetainfo in associatedmeta) { - if (relatedmetainfo.format == '0.2') { - def childmetainfo = openchildmeta(gatheredpath, relatedmetainfo) - if (childmetainfo.imported) { - results = childmetainfo.childmeta.walkrelated(results.metacollection, results.comment, level + 1, childmetainfo.nextpath) + if (!limiteddepth || maxdepth > 0) { + results.metacollection.add(this) + results.comment += "${level} ".padRight(level * 4) + globalreleasetag() + '\n' + for (relatedmetainfo in associatedmeta) { + if (relatedmetainfo.format == '0.2') { + def childmetainfo = openchildmeta(gatheredpath, relatedmetainfo) + if (childmetainfo.imported) { + results = childmetainfo.childmeta.walkrelated(results.metacollection, results.comment, level + 1, childmetainfo.nextpath, limiteddepth, maxdepth - 1) + } + } else if (relatedmetainfo.format == '0.1') { + def MetaInfo othermeta = relatedmetainfo.meta + results = othermeta.walkrelated_v0_1(results.metacollection, results.comment, level + 1, limiteddepth, maxdepth - 1) } - } else if (relatedmetainfo.format == '0.1') { - def MetaInfo othermeta = relatedmetainfo.meta - results = othermeta.walkrelated_v0_1(results.metacollection, results.comment, level + 1) } } return [ 'metacollection' : results.metacollection, 'comment': results.comment ] @@ -1048,6 +989,36 @@ class MetaInfo extends GISJsonSerialised { return walkrelated(metacollection) } + ArrayList releasewalker(int maxdepth, String startpath = '') { + def ArrayList metacollection = new ArrayList() + def results = walkrelated(metacollection, '', 0, startpath, true, maxdepth) + return results.metacollection + } + + Map releasewalkerversionunique(int maxdepth, String startpath = '') { + def ArrayList metacollection = releasewalker(maxdepth, startpath) + + def Map versionuniquecollection = new LinkedHashMap() + for (metainfo in metacollection) { + def String uniquestring = metainfo.componentversionuniqueidentifier() + versionuniquecollection.put(uniquestring, metainfo) + } + + return versionuniquecollection + } + + Map releasewalkerunique(int maxdepth, String startpath = '') { + def ArrayList metacollection = releasewalker(maxdepth, startpath) + + def Map uniquecollection = new LinkedHashMap() + for (metainfo in metacollection) { + def String uniquestring = metainfo.componentidentifier() + uniquecollection.put(uniquestring, metainfo) + } + + return uniquecollection + } + MetaInfo getNewMetaObject(script) { return new MetaInfo(script) } From 1ee2be62fff8ed870aee9433252fa30800d2bd40 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Wed, 15 Dec 2021 14:11:39 +0000 Subject: [PATCH 061/182] Use importer to get build artifacts to release --- release/release.groovy | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/release/release.groovy b/release/release.groovy index 42357fc..5c9925e 100644 --- a/release/release.groovy +++ b/release/release.groovy @@ -23,18 +23,15 @@ pipeline { stage('Get build artifact meta') { steps { script { + importer = load("${autobuilder.commonscripts()}/import/importer.groovy") + BUILD_ARTIFACTS = "${WORKSPACE}/build_artifacts" - copyArtifacts( - filter: 'meta/**', - projectName: BUILD_JOB, - selector: [ - $class: 'ParameterizedBuildSelector', - parameterName: BUILD_JOB_SELECTOR - ], - target: BUILD_ARTIFACTS - ) - def mfs = autobuilderscript.getmetafolderscript() - buildmeta = mfs.metafromfolder(BUILD_ARTIFACTS) + + def importoptions = importer.getNewImportOptions() + importoptions.jenkinsjob(BUILD_JOB, BUILD_JOB_SELECTOR) + importoptions.setincrementversionnumber(false) + importoptions.setfilter('meta/**') + buildmeta = importer.artifactimport(meta, controlimportoptions, BUILD_ARTIFACTS) } } } From 7d8e910d202e2ee029d7d5dc91cdf48afb10575b Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Wed, 15 Dec 2021 14:12:47 +0000 Subject: [PATCH 062/182] Use importer to get build artifacts to release --- release/release.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release/release.groovy b/release/release.groovy index 5c9925e..918c386 100644 --- a/release/release.groovy +++ b/release/release.groovy @@ -31,7 +31,7 @@ pipeline { importoptions.jenkinsjob(BUILD_JOB, BUILD_JOB_SELECTOR) importoptions.setincrementversionnumber(false) importoptions.setfilter('meta/**') - buildmeta = importer.artifactimport(meta, controlimportoptions, BUILD_ARTIFACTS) + buildmeta = importer.artifactimport(meta, importoptions, BUILD_ARTIFACTS) } } } From 96621af758c19411cdd68230ac773f140b76c511 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Wed, 15 Dec 2021 14:27:21 +0000 Subject: [PATCH 063/182] Use importer to get build artifacts to release --- release/release.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release/release.groovy b/release/release.groovy index 918c386..17f5185 100644 --- a/release/release.groovy +++ b/release/release.groovy @@ -25,7 +25,7 @@ pipeline { script { importer = load("${autobuilder.commonscripts()}/import/importer.groovy") - BUILD_ARTIFACTS = "${WORKSPACE}/build_artifacts" + BUILD_ARTIFACTS = "${WORKSPACE}" def importoptions = importer.getNewImportOptions() importoptions.jenkinsjob(BUILD_JOB, BUILD_JOB_SELECTOR) From aff9e3e106c195703501e06f633fe178503cb7aa Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Wed, 15 Dec 2021 14:31:46 +0000 Subject: [PATCH 064/182] Use importer to get build artifacts to release --- release/release.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release/release.groovy b/release/release.groovy index 17f5185..8f7d129 100644 --- a/release/release.groovy +++ b/release/release.groovy @@ -25,7 +25,7 @@ pipeline { script { importer = load("${autobuilder.commonscripts()}/import/importer.groovy") - BUILD_ARTIFACTS = "${WORKSPACE}" + BUILD_ARTIFACTS = '.' def importoptions = importer.getNewImportOptions() importoptions.jenkinsjob(BUILD_JOB, BUILD_JOB_SELECTOR) From f3a0f9fcc95a886543e22e0611c6c188484b423f Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Wed, 15 Dec 2021 14:35:17 +0000 Subject: [PATCH 065/182] Use importer to get build artifacts to release --- release/release.groovy | 1 + 1 file changed, 1 insertion(+) diff --git a/release/release.groovy b/release/release.groovy index 8f7d129..daf42aa 100644 --- a/release/release.groovy +++ b/release/release.groovy @@ -31,6 +31,7 @@ pipeline { importoptions.jenkinsjob(BUILD_JOB, BUILD_JOB_SELECTOR) importoptions.setincrementversionnumber(false) importoptions.setfilter('meta/**') + importoptions.clean(false) buildmeta = importer.artifactimport(meta, importoptions, BUILD_ARTIFACTS) } } From fc34f642388f769ae727dd3c73bfe4bfd6e5009f Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Wed, 15 Dec 2021 14:37:12 +0000 Subject: [PATCH 066/182] Use importer to get build artifacts to release --- release/release.groovy | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/release/release.groovy b/release/release.groovy index daf42aa..2c168b9 100644 --- a/release/release.groovy +++ b/release/release.groovy @@ -25,13 +25,12 @@ pipeline { script { importer = load("${autobuilder.commonscripts()}/import/importer.groovy") - BUILD_ARTIFACTS = '.' + BUILD_ARTIFACTS = 'build' def importoptions = importer.getNewImportOptions() importoptions.jenkinsjob(BUILD_JOB, BUILD_JOB_SELECTOR) importoptions.setincrementversionnumber(false) importoptions.setfilter('meta/**') - importoptions.clean(false) buildmeta = importer.artifactimport(meta, importoptions, BUILD_ARTIFACTS) } } From 135fddb356051307cf93e02d2e90bd47a0be84df Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Wed, 15 Dec 2021 14:41:45 +0000 Subject: [PATCH 067/182] Use importer to get build artifacts to release --- release/release.groovy | 1 + 1 file changed, 1 insertion(+) diff --git a/release/release.groovy b/release/release.groovy index 2c168b9..20f520c 100644 --- a/release/release.groovy +++ b/release/release.groovy @@ -31,6 +31,7 @@ pipeline { importoptions.jenkinsjob(BUILD_JOB, BUILD_JOB_SELECTOR) importoptions.setincrementversionnumber(false) importoptions.setfilter('meta/**') + importoptions.setappendtoparentmeta(false) buildmeta = importer.artifactimport(meta, importoptions, BUILD_ARTIFACTS) } } From e35826fb24014d77f52fae247010b775c190da5e Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Wed, 15 Dec 2021 14:45:18 +0000 Subject: [PATCH 068/182] Use importer to get build artifacts to release --- release/do.groovy | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/release/do.groovy b/release/do.groovy index e0b9471..3430342 100644 --- a/release/do.groovy +++ b/release/do.groovy @@ -396,13 +396,16 @@ def releasecomponent(toplevelbuildmeta, buildinfo, String otherreleasetags, Stri repoandtagsappend("\n") } -def releasehierarchy(buildmeta, String maxdepth, String otherreleasetags, String dryrunpush) { +def releasehierarchy(buildfolder, buildmeta, String maxdepth, String otherreleasetags, String dryrunpush) { def int md = maxdepth.toInteger() resetfolders() preconditions() // Walk the meta information to a max depth, looking for components to release - def componentReleaseInfo = buildmeta.releasewalkerunique(md) + def componentReleaseInfo + dir(buildfolder) { + componentReleaseInfo = buildmeta.releasewalkerunique(md) + } echo "Unique components:" def String versioncomponent = "" for (key in componentReleaseInfo.keySet()) { From b64672cc94017ad76223e26e9eaa9b801e1ab2fc Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Wed, 15 Dec 2021 14:47:28 +0000 Subject: [PATCH 069/182] Use importer to get build artifacts to release --- release/release.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release/release.groovy b/release/release.groovy index 20f520c..2324b60 100644 --- a/release/release.groovy +++ b/release/release.groovy @@ -42,7 +42,7 @@ pipeline { def releaser = load("${autobuilder.commonscripts()}/release/do.groovy") // Place the top level build stamp on all OTHER_RELEASE_TAGS = "${buildmeta.globalreleasetag()},${OTHER_RELEASE_TAGS}" - (summarystring, markunstable, unstablereason) = releaser.releasehierarchy(buildmeta, MAX_META_DEPTH, OTHER_RELEASE_TAGS, DRY_RUN_PUSH) + (summarystring, markunstable, unstablereason) = releaser.releasehierarchy(BUILD_ARTIFACTS, buildmeta, MAX_META_DEPTH, OTHER_RELEASE_TAGS, DRY_RUN_PUSH) if (markunstable) { env.unstablereason = unstablereason currentBuild.result = 'UNSTABLE' From f41768212cc3352a3e01e424d118253a5b31f870 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Wed, 15 Dec 2021 14:56:32 +0000 Subject: [PATCH 070/182] Use importer to get build artifacts to release --- meta/folder.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta/folder.groovy b/meta/folder.groovy index adf124a..88e05e5 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -991,7 +991,7 @@ class MetaInfo extends GISJsonSerialised { ArrayList releasewalker(int maxdepth, String startpath = '') { def ArrayList metacollection = new ArrayList() - def results = walkrelated(metacollection, '', 0, startpath, true, maxdepth) + def results = walkrelated(metacollection, 'meta', 0, startpath, true, maxdepth) return results.metacollection } From 82dc66da2f754714e99b91e9e29845ff7dcfb37b Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Wed, 15 Dec 2021 21:34:55 +0000 Subject: [PATCH 071/182] Use importer to get build artifacts to release --- meta/folder.groovy | 2 ++ 1 file changed, 2 insertions(+) diff --git a/meta/folder.groovy b/meta/folder.groovy index 88e05e5..499535a 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -942,6 +942,7 @@ class MetaInfo extends GISJsonSerialised { } def walkrelated_v0_1(ArrayList metacollection, String comment = '', int level = 0, boolean limiteddepth = false, int maxdepth = 0) { + script.echo("walkrelated_v0_1 Iteration:\nLevel: ${level}\nLimited depth: ${limiteddepth}\nMax depth: ${maxdepth}") def results = [ 'metacollection' : metacollection, 'comment': comment @@ -962,6 +963,7 @@ class MetaInfo extends GISJsonSerialised { } def walkrelated(ArrayList metacollection, String comment = '', int level = 0, String gatheredpath = '', boolean limiteddepth = false, int maxdepth = 0) { + script.echo("walkrelated Iteration:\nLevel: ${level}\nGathered path: ${gatheredpath}\nLimited depth: ${limiteddepth}\nMax depth: ${maxdepth}") def results = [ 'metacollection' : metacollection, 'comment': comment From 5b350028ea1a0391199b6f014a389dc31e69cd04 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Wed, 15 Dec 2021 22:02:04 +0000 Subject: [PATCH 072/182] Try to walk through build meta items --- release/do.groovy | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/release/do.groovy b/release/do.groovy index 3430342..563a49f 100644 --- a/release/do.groovy +++ b/release/do.groovy @@ -402,10 +402,7 @@ def releasehierarchy(buildfolder, buildmeta, String maxdepth, String otherreleas preconditions() // Walk the meta information to a max depth, looking for components to release - def componentReleaseInfo - dir(buildfolder) { - componentReleaseInfo = buildmeta.releasewalkerunique(md) - } + def componentReleaseInfo = buildmeta.releasewalkerunique(md, buildfolder) echo "Unique components:" def String versioncomponent = "" for (key in componentReleaseInfo.keySet()) { From 99aa54ae8e6908083bbf02a1f49e62ddb12f956b Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Wed, 15 Dec 2021 22:13:33 +0000 Subject: [PATCH 073/182] Try to walk through build meta items --- meta/folder.groovy | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meta/folder.groovy b/meta/folder.groovy index 499535a..3f60bfa 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -998,7 +998,7 @@ class MetaInfo extends GISJsonSerialised { } Map releasewalkerversionunique(int maxdepth, String startpath = '') { - def ArrayList metacollection = releasewalker(maxdepth, startpath) + def ArrayList metacollection = releasewalker(maxdepth, "${startpath}/${METAFOLDERNAME}") def Map versionuniquecollection = new LinkedHashMap() for (metainfo in metacollection) { @@ -1010,7 +1010,7 @@ class MetaInfo extends GISJsonSerialised { } Map releasewalkerunique(int maxdepth, String startpath = '') { - def ArrayList metacollection = releasewalker(maxdepth, startpath) + def ArrayList metacollection = releasewalker(maxdepth, "${startpath}/${METAFOLDERNAME}") def Map uniquecollection = new LinkedHashMap() for (metainfo in metacollection) { From b973208999feeea379038cc13a2297495fc02c5b Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Wed, 15 Dec 2021 22:20:07 +0000 Subject: [PATCH 074/182] Try to walk through build meta items --- release/do.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release/do.groovy b/release/do.groovy index 563a49f..d131173 100644 --- a/release/do.groovy +++ b/release/do.groovy @@ -411,7 +411,7 @@ def releasehierarchy(buildfolder, buildmeta, String maxdepth, String otherreleas echo versioncomponent // Walk the meta information to a max depth, looking for components to release - def componentReleaseInfoVersionUnique = buildmeta.releasewalkerversionunique(md) + def componentReleaseInfoVersionUnique = buildmeta.releasewalkerversionunique(md, buildfolder) echo "Version unique components:" def String versionuniquecomponent = "" for (key in componentReleaseInfoVersionUnique.keySet()) { From ece26703656703826e0ab36307710b30d0181031 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Thu, 16 Dec 2021 15:39:32 +0000 Subject: [PATCH 075/182] Make the walkers carry more meta data --- meta/folder.groovy | 111 +++++++++++++++++++++++++++++++-------------- 1 file changed, 76 insertions(+), 35 deletions(-) diff --git a/meta/folder.groovy b/meta/folder.groovy index 3f60bfa..fb10cbd 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -914,16 +914,32 @@ class MetaInfo extends GISJsonSerialised { return buildstampinfo.buildstamp + "-" + jenkinsbuildinfo.buildnumber } - def openchildmeta(String gatheredpath, RelatedMetaInfo relatedmetainfo) { + class CollectedMeta { + private MetaInfo metainfo + private String accumulatedpath + + CollectedMeta(MetaInfo metainfo, String accumulatedpath = '') { + this.metainfo = metainfo + this.accumulatedpath = accumulatedpath + } + } + + def openchildmeta(String gatheredpath, String gatheredmetapath, RelatedMetaInfo relatedmetainfo) { def MetaInfo mi = new MetaInfo(script) - def String nextpath + def String nextgatheredpath if (gatheredpath == '') { - nextpath = "${relatedmetainfo.offsetpath}/${METAFOLDERNAME}" + nextgatheredpath = "${relatedmetainfo.offsetpath}" } else { - nextpath = "${gatheredpath}/${relatedmetainfo.offsetpath}" + nextgatheredpath = "${gatheredpath}/${relatedmetainfo.offsetpath}" } - def importedmetafile = "${nextpath}/${METAFILENAME}" + def String nextgatheredmetapath + if (gatheredmetapath == '') { + nextgatheredmetapath = "${relatedmetainfo.offsetpath}/${METAFOLDERNAME}" + } else { + nextgatheredmetapath = "${gatheredmetapath}/${relatedmetainfo.offsetpath}" + } + def importedmetafile = "${nextgatheredmetapath}/${METAFILENAME}" def boolean imported if (script.fileExists(importedmetafile)) { mi.deserialiseJson(importedmetafile) @@ -935,25 +951,38 @@ class MetaInfo extends GISJsonSerialised { def childmetainfo = [ 'imported': imported, - 'nextpath': nextpath, + 'nextgatheredpath': nextgatheredpath, + 'nextgatheredmetapath': nextgatheredmetapath, 'childmeta': mi ] return childmetainfo } - def walkrelated_v0_1(ArrayList metacollection, String comment = '', int level = 0, boolean limiteddepth = false, int maxdepth = 0) { - script.echo("walkrelated_v0_1 Iteration:\nLevel: ${level}\nLimited depth: ${limiteddepth}\nMax depth: ${maxdepth}") + def walkrelated_v0_1(ArrayList metacollection, + String comment = '', + int level = 0, + String gatheredpath = '', + String gatheredmetapath = '', + boolean limiteddepth = false, + int maxdepth = 0) { + script.echo("walkrelated_v0_1 Iteration:\nLevel: ${level}\nGathered path: ${gatheredpath}\nGathered meta path: ${gatheredmetapath}\nLimited depth: ${limiteddepth}\nMax depth: ${maxdepth}") def results = [ 'metacollection' : metacollection, 'comment': comment ] if (!limiteddepth || maxdepth > 0) { - results.metacollection.add(this) + results.metacollection.add(new CollectedMeta(this, gatheredpath)) results.comment += "${level} ".padRight(level * 4) + globalreleasetag() + '\n' for (relatedmetainfo in associatedmeta) { if (!relatedmetainfo.format || relatedmetainfo.format == '0.1') { def MetaInfo othermeta = relatedmetainfo.meta - results = othermeta.walkrelated_v0_1(results.metacollection, results.comment, level + 1, limiteddepth, maxdepth - 1) + results = othermeta.walkrelated_v0_1(results.metacollection, + results.comment, + level + 1, + "${gatheredpath}/${relatedmetainfo.offsetpath}", + "${gatheredmetapath}/${relatedmetainfo.offsetpath}", + limiteddepth, + maxdepth - 1) } else { script.error("There is non v0.1 format related meta info under v0.1 related meta info") } @@ -962,24 +991,36 @@ class MetaInfo extends GISJsonSerialised { return [ 'metacollection' : results.metacollection, 'comment': results.comment ] } - def walkrelated(ArrayList metacollection, String comment = '', int level = 0, String gatheredpath = '', boolean limiteddepth = false, int maxdepth = 0) { - script.echo("walkrelated Iteration:\nLevel: ${level}\nGathered path: ${gatheredpath}\nLimited depth: ${limiteddepth}\nMax depth: ${maxdepth}") + def walkrelated(ArrayList metacollection, + String comment = '', + int level = 0, + String gatheredpath = '', + String gatheredmetapath = '', + boolean limiteddepth = false, + int maxdepth = 0) { + script.echo("walkrelated Iteration:\nLevel: ${level}\nGathered path: ${gatheredpath}\nGathered meta path: ${gatheredmetapath}\nLimited depth: ${limiteddepth}\nMax depth: ${maxdepth}") def results = [ 'metacollection' : metacollection, 'comment': comment ] if (!limiteddepth || maxdepth > 0) { - results.metacollection.add(this) + results.metacollection.add(new CollectedMeta(this, gatheredpath)) results.comment += "${level} ".padRight(level * 4) + globalreleasetag() + '\n' for (relatedmetainfo in associatedmeta) { if (relatedmetainfo.format == '0.2') { - def childmetainfo = openchildmeta(gatheredpath, relatedmetainfo) + def childmetainfo = openchildmeta(gatheredpath, gatheredmetapath, relatedmetainfo) if (childmetainfo.imported) { - results = childmetainfo.childmeta.walkrelated(results.metacollection, results.comment, level + 1, childmetainfo.nextpath, limiteddepth, maxdepth - 1) + results = childmetainfo.childmeta.walkrelated(results.metacollection, + results.comment, + level + 1, + childmetainfo.nextgatheredpath + childmetainfo.nextgatheredmetapath, + limiteddepth, + maxdepth - 1) } } else if (relatedmetainfo.format == '0.1') { def MetaInfo othermeta = relatedmetainfo.meta - results = othermeta.walkrelated_v0_1(results.metacollection, results.comment, level + 1, limiteddepth, maxdepth - 1) + results = othermeta.walkrelated_v0_1(results.metacollection, results.comment, level + 1, gatheredpath, gatheredmetapath, limiteddepth, maxdepth - 1) } } } @@ -987,23 +1028,23 @@ class MetaInfo extends GISJsonSerialised { } def allrelatedmeta() { - ArrayList metacollection = new ArrayList() + ArrayList metacollection = new ArrayList() return walkrelated(metacollection) } - ArrayList releasewalker(int maxdepth, String startpath = '') { - def ArrayList metacollection = new ArrayList() - def results = walkrelated(metacollection, 'meta', 0, startpath, true, maxdepth) + ArrayList releasewalker(int maxdepth, String startpath = '', String startmetapath = '') { + def ArrayList metacollection = new ArrayList() + def results = walkrelated(metacollection, 'meta', 0, startpath, startmetapath, true, maxdepth) return results.metacollection } - Map releasewalkerversionunique(int maxdepth, String startpath = '') { - def ArrayList metacollection = releasewalker(maxdepth, "${startpath}/${METAFOLDERNAME}") + Map releasewalkerversionunique(int maxdepth, String startpath = '', String startmetapath = '') { + def ArrayList metacollection = releasewalker(maxdepth, "${startpath}/${METAFOLDERNAME}", startmetapath) - def Map versionuniquecollection = new LinkedHashMap() - for (metainfo in metacollection) { - def String uniquestring = metainfo.componentversionuniqueidentifier() - versionuniquecollection.put(uniquestring, metainfo) + def Map versionuniquecollection = new LinkedHashMap() + for (metaitem in metacollection) { + def String uniquestring = metaitem.metainfo.componentversionuniqueidentifier() + versionuniquecollection.put(uniquestring, metaitem) } return versionuniquecollection @@ -1013,9 +1054,9 @@ class MetaInfo extends GISJsonSerialised { def ArrayList metacollection = releasewalker(maxdepth, "${startpath}/${METAFOLDERNAME}") def Map uniquecollection = new LinkedHashMap() - for (metainfo in metacollection) { - def String uniquestring = metainfo.componentidentifier() - uniquecollection.put(uniquestring, metainfo) + for (metaitem in metacollection) { + def String uniquestring = metaitem.metainfo.componentidentifier() + uniquecollection.put(uniquestring, metaitem) } return uniquecollection @@ -1027,15 +1068,15 @@ class MetaInfo extends GISJsonSerialised { def findAssociatedMeta(String productname, String subcomponentname) { def results = [ - 'matchedmeta' : getNewMetaObject(this), + 'matchedmetaitem' : new CollectedMeta(this), 'matchfound' : false ] def walkresults = allrelatedmeta() - for (dependentmeta in walkresults.metacollection) { - if (dependentmeta.productinfo.productname == productname && - dependentmeta.productinfo.subcomponentname == subcomponentname) { - script.echo("Found matching component: ${dependentmeta.globalreleasetag()}") - results.matchedmeta = dependentmeta + for (dependentmetaitem in walkresults.metacollection) { + if (dependentmetaitem.metainfo.productinfo.productname == productname && + dependentmetaitem.metainfo.productinfo.subcomponentname == subcomponentname) { + script.echo("Found matching component: ${dependentmetaitem.metainfo.globalreleasetag()}") + results.matchedmetaitem = dependentmetaitem results.matchfound = true break } From 755bb994d0842fe3e52df721706c83b6a34efda9 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Fri, 17 Dec 2021 10:46:47 +0000 Subject: [PATCH 076/182] Wipe out an additional folder that the logic is now exporting --- copy/logic.groovy | 1 + 1 file changed, 1 insertion(+) diff --git a/copy/logic.groovy b/copy/logic.groovy index 9585f01..7bc94d1 100644 --- a/copy/logic.groovy +++ b/copy/logic.groovy @@ -17,6 +17,7 @@ pipeline { cleanfolders = [ LOGICDEST, "${WORKSPACE}/embedded_logic", + "${WORKSPACE}/el", ] cleaner = load("${autobuilder.commonscripts()}/clean/clean.groovy") cleaner.clean(cleanfolders) From 053b39b3df1bbf2f344cdc8ba7701f7fe94f038f Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Fri, 17 Dec 2021 11:23:05 +0000 Subject: [PATCH 077/182] Make the walkers carry more meta data --- meta/folder.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta/folder.groovy b/meta/folder.groovy index fb10cbd..0fd0d8e 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -1013,7 +1013,7 @@ class MetaInfo extends GISJsonSerialised { results = childmetainfo.childmeta.walkrelated(results.metacollection, results.comment, level + 1, - childmetainfo.nextgatheredpath + childmetainfo.nextgatheredpath, childmetainfo.nextgatheredmetapath, limiteddepth, maxdepth - 1) From 93ad1bea33bd4304e831232dca66af2ee683b69a Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Fri, 17 Dec 2021 11:50:07 +0000 Subject: [PATCH 078/182] Make the walkers carry more meta data --- meta/folder.groovy | 8 ++++---- release/do.groovy | 6 +++--- release/release.groovy | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/meta/folder.groovy b/meta/folder.groovy index 0fd0d8e..1c6441b 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -1039,7 +1039,7 @@ class MetaInfo extends GISJsonSerialised { } Map releasewalkerversionunique(int maxdepth, String startpath = '', String startmetapath = '') { - def ArrayList metacollection = releasewalker(maxdepth, "${startpath}/${METAFOLDERNAME}", startmetapath) + def ArrayList metacollection = releasewalker(maxdepth, startpath, "${startmetapath}/${METAFOLDERNAME}") def Map versionuniquecollection = new LinkedHashMap() for (metaitem in metacollection) { @@ -1050,10 +1050,10 @@ class MetaInfo extends GISJsonSerialised { return versionuniquecollection } - Map releasewalkerunique(int maxdepth, String startpath = '') { - def ArrayList metacollection = releasewalker(maxdepth, "${startpath}/${METAFOLDERNAME}") + Map releasewalkerunique(int maxdepth, String startpath = '', String startmetapath = '') { + def ArrayList metacollection = releasewalker(maxdepth, startpath, "${startmetapath}/${METAFOLDERNAME}") - def Map uniquecollection = new LinkedHashMap() + def Map uniquecollection = new LinkedHashMap() for (metaitem in metacollection) { def String uniquestring = metaitem.metainfo.componentidentifier() uniquecollection.put(uniquestring, metaitem) diff --git a/release/do.groovy b/release/do.groovy index d131173..133d425 100644 --- a/release/do.groovy +++ b/release/do.groovy @@ -396,13 +396,13 @@ def releasecomponent(toplevelbuildmeta, buildinfo, String otherreleasetags, Stri repoandtagsappend("\n") } -def releasehierarchy(buildfolder, buildmeta, String maxdepth, String otherreleasetags, String dryrunpush) { +def releasehierarchy(String buildfolder, String metafolder, buildmeta, String maxdepth, String otherreleasetags, String dryrunpush) { def int md = maxdepth.toInteger() resetfolders() preconditions() // Walk the meta information to a max depth, looking for components to release - def componentReleaseInfo = buildmeta.releasewalkerunique(md, buildfolder) + def componentReleaseInfo = buildmeta.releasewalkerunique(md, buildfolder, metafolder) echo "Unique components:" def String versioncomponent = "" for (key in componentReleaseInfo.keySet()) { @@ -411,7 +411,7 @@ def releasehierarchy(buildfolder, buildmeta, String maxdepth, String otherreleas echo versioncomponent // Walk the meta information to a max depth, looking for components to release - def componentReleaseInfoVersionUnique = buildmeta.releasewalkerversionunique(md, buildfolder) + def componentReleaseInfoVersionUnique = buildmeta.releasewalkerversionunique(md, buildfolder metafolder) echo "Version unique components:" def String versionuniquecomponent = "" for (key in componentReleaseInfoVersionUnique.keySet()) { diff --git a/release/release.groovy b/release/release.groovy index 2324b60..82af511 100644 --- a/release/release.groovy +++ b/release/release.groovy @@ -42,7 +42,7 @@ pipeline { def releaser = load("${autobuilder.commonscripts()}/release/do.groovy") // Place the top level build stamp on all OTHER_RELEASE_TAGS = "${buildmeta.globalreleasetag()},${OTHER_RELEASE_TAGS}" - (summarystring, markunstable, unstablereason) = releaser.releasehierarchy(BUILD_ARTIFACTS, buildmeta, MAX_META_DEPTH, OTHER_RELEASE_TAGS, DRY_RUN_PUSH) + (summarystring, markunstable, unstablereason) = releaser.releasehierarchy('', BUILD_ARTIFACTS, buildmeta, MAX_META_DEPTH, OTHER_RELEASE_TAGS, DRY_RUN_PUSH) if (markunstable) { env.unstablereason = unstablereason currentBuild.result = 'UNSTABLE' From 61e2834a1b7c11a77eb0b7675579cb7e044ce073 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Fri, 17 Dec 2021 11:58:52 +0000 Subject: [PATCH 079/182] Make the walkers carry more meta data --- release/do.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release/do.groovy b/release/do.groovy index 133d425..2f175ea 100644 --- a/release/do.groovy +++ b/release/do.groovy @@ -411,7 +411,7 @@ def releasehierarchy(String buildfolder, String metafolder, buildmeta, String ma echo versioncomponent // Walk the meta information to a max depth, looking for components to release - def componentReleaseInfoVersionUnique = buildmeta.releasewalkerversionunique(md, buildfolder metafolder) + def componentReleaseInfoVersionUnique = buildmeta.releasewalkerversionunique(md, buildfolder, metafolder) echo "Version unique components:" def String versionuniquecomponent = "" for (key in componentReleaseInfoVersionUnique.keySet()) { From 4b72bba43e0082fc7beca9399122248e9287771c Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Fri, 17 Dec 2021 12:29:11 +0000 Subject: [PATCH 080/182] Make the walkers carry more meta data --- meta/folder.groovy | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/meta/folder.groovy b/meta/folder.groovy index 1c6441b..eef608d 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -917,10 +917,12 @@ class MetaInfo extends GISJsonSerialised { class CollectedMeta { private MetaInfo metainfo private String accumulatedpath + private String accumulatedmetapath - CollectedMeta(MetaInfo metainfo, String accumulatedpath = '') { + CollectedMeta(MetaInfo metainfo, String accumulatedpath = '', String accumulatedmetapath = '') { this.metainfo = metainfo this.accumulatedpath = accumulatedpath + this.accumulatedmetapath = accumulatedmetapath } } @@ -971,7 +973,7 @@ class MetaInfo extends GISJsonSerialised { 'comment': comment ] if (!limiteddepth || maxdepth > 0) { - results.metacollection.add(new CollectedMeta(this, gatheredpath)) + results.metacollection.add(new CollectedMeta(this, gatheredpath, gatheredmetapath)) results.comment += "${level} ".padRight(level * 4) + globalreleasetag() + '\n' for (relatedmetainfo in associatedmeta) { if (!relatedmetainfo.format || relatedmetainfo.format == '0.1') { @@ -1004,7 +1006,7 @@ class MetaInfo extends GISJsonSerialised { 'comment': comment ] if (!limiteddepth || maxdepth > 0) { - results.metacollection.add(new CollectedMeta(this, gatheredpath)) + results.metacollection.add(new CollectedMeta(this, gatheredpath, gatheredmetapath)) results.comment += "${level} ".padRight(level * 4) + globalreleasetag() + '\n' for (relatedmetainfo in associatedmeta) { if (relatedmetainfo.format == '0.2') { @@ -1038,13 +1040,25 @@ class MetaInfo extends GISJsonSerialised { return results.metacollection } + Map putwithshortestoffsetpath(Map releasemetacollection, String uniquestring, CollectedMeta metaitem) { + if (releasemetacollection.containsKey(uniquestring)) { + def existingentry = releasemetacollection[uniquestring] + if (existingentry.accumulatedpath.size() > metaitem.accumulatedpath.size()) { + releasemetacollection.put(uniquestring, metaitem) + } + } else { + releasemetacollection.put(uniquestring, metaitem) + } + return releasemetacollection + } + Map releasewalkerversionunique(int maxdepth, String startpath = '', String startmetapath = '') { def ArrayList metacollection = releasewalker(maxdepth, startpath, "${startmetapath}/${METAFOLDERNAME}") def Map versionuniquecollection = new LinkedHashMap() for (metaitem in metacollection) { def String uniquestring = metaitem.metainfo.componentversionuniqueidentifier() - versionuniquecollection.put(uniquestring, metaitem) + versionuniquecollection = putwithshortestoffsetpath(uniquestring, metaitem) } return versionuniquecollection @@ -1056,7 +1070,7 @@ class MetaInfo extends GISJsonSerialised { def Map uniquecollection = new LinkedHashMap() for (metaitem in metacollection) { def String uniquestring = metaitem.metainfo.componentidentifier() - uniquecollection.put(uniquestring, metaitem) + versionuniquecollection = putwithshortestoffsetpath(uniquestring, metaitem) } return uniquecollection From dcd5fe6382f62202e124b296edb500c5d3b1e3ba Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Fri, 17 Dec 2021 12:31:24 +0000 Subject: [PATCH 081/182] Make the walkers carry more meta data --- meta/folder.groovy | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meta/folder.groovy b/meta/folder.groovy index eef608d..9934287 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -1058,7 +1058,7 @@ class MetaInfo extends GISJsonSerialised { def Map versionuniquecollection = new LinkedHashMap() for (metaitem in metacollection) { def String uniquestring = metaitem.metainfo.componentversionuniqueidentifier() - versionuniquecollection = putwithshortestoffsetpath(uniquestring, metaitem) + versionuniquecollection = putwithshortestoffsetpath(versionuniquecollection, uniquestring, metaitem) } return versionuniquecollection @@ -1070,7 +1070,7 @@ class MetaInfo extends GISJsonSerialised { def Map uniquecollection = new LinkedHashMap() for (metaitem in metacollection) { def String uniquestring = metaitem.metainfo.componentidentifier() - versionuniquecollection = putwithshortestoffsetpath(uniquestring, metaitem) + versionuniquecollection = putwithshortestoffsetpath(versionuniquecollection, uniquestring, metaitem) } return uniquecollection From 55a087b237e35f3a0363bc0db933162ed88b34ad Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Fri, 17 Dec 2021 12:32:48 +0000 Subject: [PATCH 082/182] Make the walkers carry more meta data --- meta/folder.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta/folder.groovy b/meta/folder.groovy index 9934287..fb27e64 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -1070,7 +1070,7 @@ class MetaInfo extends GISJsonSerialised { def Map uniquecollection = new LinkedHashMap() for (metaitem in metacollection) { def String uniquestring = metaitem.metainfo.componentidentifier() - versionuniquecollection = putwithshortestoffsetpath(versionuniquecollection, uniquestring, metaitem) + uniquecollection = putwithshortestoffsetpath(uniquecollection, uniquestring, metaitem) } return uniquecollection From a342a0f482410c9eb50f6729267e14baf9c60066 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Fri, 17 Dec 2021 12:40:42 +0000 Subject: [PATCH 083/182] Alter release process to handle new meta walker info --- release/do.groovy | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/release/do.groovy b/release/do.groovy index 2f175ea..8a2ea61 100644 --- a/release/do.groovy +++ b/release/do.groovy @@ -112,10 +112,10 @@ def boolean getcomponentartifacts(toplevelbuildmeta, buildinfo, String repofolde // Copy relevant artifacts to temp folder summaryappend("Artifacts: ") def boolean result = true - for (artifactfilter in buildinfo.meta.releaseinfo.releaseitems) { + for (artifactfilter in buildinfo.metainfo.releaseinfo.releaseitems) { def filterpath = artifactfilter - if (buildinfo.offsetpath) { - filterpath = buildinfo.offsetpath + '/' + artifactfilter + if (buildinfo.accumulatedpath) { + filterpath = buildinfo.accumulatedpath + '/' + artifactfilter } // Copy relevant artifacts to temp folder echo "Copying artifacts: ${filterpath} to ${tempfolder}" @@ -136,7 +136,7 @@ def boolean getcomponentartifacts(toplevelbuildmeta, buildinfo, String repofolde } if (result) { // Move relevant artifacts from temp folder to release position - def originalrootdir = tempfolder + "/" + buildinfo.offsetpath + def originalrootdir = tempfolder + "/" + buildinfo.accumulatedpath dir(originalrootdir) { sh("mv * ${repofolder}") } @@ -375,7 +375,7 @@ def gitrelease(buildmeta, previousreleasemeta, String releaserepo, String source } def releasecomponent(toplevelbuildmeta, buildinfo, String otherreleasetags, String dryrunpush) { - def buildmeta = buildinfo.meta + def buildmeta = buildinfo.metainfo def uriconverted = gh.uniquereporootname(buildmeta.gitinfo.remoteurl) def String uniquefolder = "${buildmeta.productinfo.productname}_${buildmeta.productinfo.subcomponentname}_${uriconverted}" def String uniquefolderforrepo = "${releaserepofolder}/${uniquefolder}" @@ -427,7 +427,7 @@ def releasehierarchy(String buildfolder, String metafolder, buildmeta, String ma for (key in componentReleaseInfo.keySet()) { def buildinfo = componentReleaseInfo[key] - if (!buildinfo.jenkinsbuildinfo.isFullBuild()) { + if (!buildinfo.metainfo.jenkinsbuildinfo.isFullBuild()) { error "The subcomponent: ${buildinfo.componentidentifier()} is not a full build (Some artifacts are missing)" } } From 206e0f30a1849f87fe8b302e224a06dd25cc4e52 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Fri, 17 Dec 2021 13:10:08 +0000 Subject: [PATCH 084/182] Alter release process to handle new meta walker info --- release/do.groovy | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/release/do.groovy b/release/do.groovy index 8a2ea61..a521427 100644 --- a/release/do.groovy +++ b/release/do.groovy @@ -118,14 +118,14 @@ def boolean getcomponentartifacts(toplevelbuildmeta, buildinfo, String repofolde filterpath = buildinfo.accumulatedpath + '/' + artifactfilter } // Copy relevant artifacts to temp folder - echo "Copying artifacts: ${filterpath} to ${tempfolder}" + echo "Copying artifacts: Filter path: ${filterpath} to ${tempfolder} from job: ${toplevelbuildmeta.jenkinsbuildinfo.buildjobname} #${toplevelbuildmeta.jenkinsbuildinfo.buildnumber}" try { copyArtifacts( filter: filterpath, projectName: toplevelbuildmeta.jenkinsbuildinfo.buildjobname, selector: [ $class: 'ParameterizedBuildSelector', - parameterName: "${toplevelbuildmeta.jenkinsbuildinfo.buildnumber}" + parameterName: "${toplevelbuildmeta.jenkinsbuildinfo.buildnumber}" ], target: tempfolder ) @@ -138,7 +138,7 @@ def boolean getcomponentartifacts(toplevelbuildmeta, buildinfo, String repofolde // Move relevant artifacts from temp folder to release position def originalrootdir = tempfolder + "/" + buildinfo.accumulatedpath dir(originalrootdir) { - sh("mv * ${repofolder}") + sh("mv -v * ${repofolder}") } } summaryappend("${artifactfilter},") From 0b057d0a0e748898aa869ade3f03d3c762c3e349 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Fri, 17 Dec 2021 13:26:48 +0000 Subject: [PATCH 085/182] Alter release process to handle new meta walker info --- release/do.groovy | 1 + 1 file changed, 1 insertion(+) diff --git a/release/do.groovy b/release/do.groovy index a521427..ca7b84e 100644 --- a/release/do.groovy +++ b/release/do.groovy @@ -134,6 +134,7 @@ def boolean getcomponentartifacts(toplevelbuildmeta, buildinfo, String repofolde result = false summaryappend("Does not exist:") } + error("Debugging") if (result) { // Move relevant artifacts from temp folder to release position def originalrootdir = tempfolder + "/" + buildinfo.accumulatedpath From 2fe1414c19ccdbe105575df964dfc62b71d256ea Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Fri, 17 Dec 2021 13:30:57 +0000 Subject: [PATCH 086/182] Alter release process to handle new meta walker info --- release/do.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release/do.groovy b/release/do.groovy index ca7b84e..d5b43ed 100644 --- a/release/do.groovy +++ b/release/do.groovy @@ -134,7 +134,6 @@ def boolean getcomponentartifacts(toplevelbuildmeta, buildinfo, String repofolde result = false summaryappend("Does not exist:") } - error("Debugging") if (result) { // Move relevant artifacts from temp folder to release position def originalrootdir = tempfolder + "/" + buildinfo.accumulatedpath @@ -143,6 +142,7 @@ def boolean getcomponentartifacts(toplevelbuildmeta, buildinfo, String repofolde } } summaryappend("${artifactfilter},") + error("Debugging") } return result } From af1c49958a82af57995d8e77b9d0723306ffad1a Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Fri, 17 Dec 2021 13:34:51 +0000 Subject: [PATCH 087/182] Alter release process to handle new meta walker info --- release/do.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release/do.groovy b/release/do.groovy index d5b43ed..8c25fc2 100644 --- a/release/do.groovy +++ b/release/do.groovy @@ -142,8 +142,8 @@ def boolean getcomponentartifacts(toplevelbuildmeta, buildinfo, String repofolde } } summaryappend("${artifactfilter},") - error("Debugging") } + error("Debugging") return result } From 2f8ac675867242232ca2003c8866b3bf7c19743f Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Fri, 17 Dec 2021 13:41:50 +0000 Subject: [PATCH 088/182] Alter release process to handle new meta walker info --- release/do.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release/do.groovy b/release/do.groovy index 8c25fc2..e7d936d 100644 --- a/release/do.groovy +++ b/release/do.groovy @@ -143,7 +143,6 @@ def boolean getcomponentartifacts(toplevelbuildmeta, buildinfo, String repofolde } summaryappend("${artifactfilter},") } - error("Debugging") return result } @@ -359,6 +358,7 @@ def gitrelease(buildmeta, previousreleasemeta, String releaserepo, String source releasegitpush(dryrunpush) } } + error("Debugging") dir(sourcerepo) { def String srcbuildstamptag = buildmeta.globalreleasetag() def String buildsha = buildmeta.gitinfo.gitrevision From 8ccca6aa15ba6375c808f0c462a735a44162fac8 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Fri, 17 Dec 2021 13:57:54 +0000 Subject: [PATCH 089/182] Alter release process to handle new meta walker info --- release/do.groovy | 1 - 1 file changed, 1 deletion(-) diff --git a/release/do.groovy b/release/do.groovy index e7d936d..a521427 100644 --- a/release/do.groovy +++ b/release/do.groovy @@ -358,7 +358,6 @@ def gitrelease(buildmeta, previousreleasemeta, String releaserepo, String source releasegitpush(dryrunpush) } } - error("Debugging") dir(sourcerepo) { def String srcbuildstamptag = buildmeta.globalreleasetag() def String buildsha = buildmeta.gitinfo.gitrevision From 236aa6fe68c8f94dbc235ff95da4b436f3593b5a Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Fri, 17 Dec 2021 14:11:41 +0000 Subject: [PATCH 090/182] Alter release process to handle new meta walker info --- release/do.groovy | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/release/do.groovy b/release/do.groovy index a521427..87eb9ae 100644 --- a/release/do.groovy +++ b/release/do.groovy @@ -412,13 +412,18 @@ def releasehierarchy(String buildfolder, String metafolder, buildmeta, String ma // Walk the meta information to a max depth, looking for components to release def componentReleaseInfoVersionUnique = buildmeta.releasewalkerversionunique(md, buildfolder, metafolder) - echo "Version unique components:" - def String versionuniquecomponent = "" + def String versionuniquecomponent = '' + def String versionwithpathscomponent = '' for (key in componentReleaseInfoVersionUnique.keySet()) { versionuniquecomponent += "${key}\n" + versionwithpathscomponent = "${key}: path: ${componentReleaseInfoVersionUnique[key].accumulatedpath} meta path: ${componentReleaseInfoVersionUnique[key].accumulatedmetapath}\n" } + echo 'Version unique components:' echo versionuniquecomponent + echo 'Version unique components with paths:' + echo versionwithpathscomponent + if (DO_INTEGRITY_CHECK == "true") { if (componentReleaseInfo.size() != componentReleaseInfoVersionUnique.size()) { error "There are 2 or more versions of the same component being used in this hierarchy: Is this correct? (If you ignore this issue, you will get an error much later because the system cannot tag 2 different commits of the associated source code with the same label)" From 9d4b6ecf836405b1e75247a29909f86cdddb98eb Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Fri, 17 Dec 2021 14:13:12 +0000 Subject: [PATCH 091/182] Alter release process to handle new meta walker info --- release/do.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release/do.groovy b/release/do.groovy index 87eb9ae..c61f1dd 100644 --- a/release/do.groovy +++ b/release/do.groovy @@ -416,7 +416,7 @@ def releasehierarchy(String buildfolder, String metafolder, buildmeta, String ma def String versionwithpathscomponent = '' for (key in componentReleaseInfoVersionUnique.keySet()) { versionuniquecomponent += "${key}\n" - versionwithpathscomponent = "${key}: path: ${componentReleaseInfoVersionUnique[key].accumulatedpath} meta path: ${componentReleaseInfoVersionUnique[key].accumulatedmetapath}\n" + versionwithpathscomponent += "${key}: path: ${componentReleaseInfoVersionUnique[key].accumulatedpath} meta path: ${componentReleaseInfoVersionUnique[key].accumulatedmetapath}\n" } echo 'Version unique components:' echo versionuniquecomponent From 29f666075f68d3769ac2149952d8f74859683eee Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Fri, 17 Dec 2021 14:22:30 +0000 Subject: [PATCH 092/182] Alter release process to handle new meta walker info --- meta/folder.groovy | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/meta/folder.groovy b/meta/folder.groovy index fb27e64..39b8d85 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -1043,7 +1043,9 @@ class MetaInfo extends GISJsonSerialised { Map putwithshortestoffsetpath(Map releasemetacollection, String uniquestring, CollectedMeta metaitem) { if (releasemetacollection.containsKey(uniquestring)) { def existingentry = releasemetacollection[uniquestring] - if (existingentry.accumulatedpath.size() > metaitem.accumulatedpath.size()) { + def existingentrypathlength = existingentry.accumulatedpath.split('/').size() + def newentrypathlength = metaitem.accumulatedpath.split('/').size() + if (existingentrypathlength > newentrypathlength) { releasemetacollection.put(uniquestring, metaitem) } } else { From 5e1a008d8f043c3d0ad9309ed7a34734f742a078 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Fri, 17 Dec 2021 15:12:33 +0000 Subject: [PATCH 093/182] Alter release process to handle new meta walker info --- check/do_meta.groovy | 6 +++--- differences/dometahierarchy.groovy | 8 ++++---- publish/do.groovy | 4 ++-- publish/publishitems.groovy | 4 ++-- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/check/do_meta.groovy b/check/do_meta.groovy index 7bfe2d1..4b8a89e 100644 --- a/check/do_meta.groovy +++ b/check/do_meta.groovy @@ -52,8 +52,8 @@ def checkhierarchy(buildmeta, String maxdepth, String buildpathroot) { echo "All components:" def String componentinfo = "" for (entry in buildinfo) { - def name = entry.meta.componentversionuniqueidentifier() - def offsetpath = entry.offsetpath + def name = entry.metainfo.componentversionuniqueidentifier() + def offsetpath = entry.accumulatedpath def abspath = "${buildpathroot}/${offsetpath}" componentinfo += "Name: ${name} \t\t\t\tPath: ${offsetpath} \t\t\t\tFile exists in import: ${fileExists(abspath)}\n" } @@ -65,7 +65,7 @@ def checkhierarchy(buildmeta, String maxdepth, String buildpathroot) { def String versioncomponent = "" for (key in componentReleaseInfo.keySet()) { def buildinfo2 = componentReleaseInfo[key] - def offsetpath = buildinfo2.offsetpath + def offsetpath = buildinfo2.accumulatedpath def abspath = "${buildpathroot}/${offsetpath}" versioncomponent += "Key: ${key} \t\t\tPath: ${offsetpath} \t\t\tFile exists in import: ${fileExists(abspath)}\n" } diff --git a/differences/dometahierarchy.groovy b/differences/dometahierarchy.groovy index 6280960..40394d5 100644 --- a/differences/dometahierarchy.groovy +++ b/differences/dometahierarchy.groovy @@ -95,8 +95,8 @@ def showmetaitems(metaitems) { String info = '' for (key in metaitems.keySet()) { def relatedmetainfo = metaitems[key] - def offsetpath = relatedmetainfo.offsetpath - info += "Name: ${key}\t\t\t\tPath: ${offsetpath}\n" + def accumulatedpath = relatedmetainfo.accumulatedpath + info += "Name: ${key}\t\t\t\tPath: ${accumulatedpath}\n" } echo info } @@ -768,8 +768,8 @@ def compare(earlymetaitems, latermetaitems, key) { boolean result = true; echo "Collecting changes between early and later versions of component: ${key}" - def earlymeta = earlymetaitems[key].meta - def latermeta = latermetaitems[key].meta + def earlymeta = earlymetaitems[key].metainfo + def latermeta = latermetaitems[key].metainfo summaryappend("${earlymeta.productinfo.productname} ${earlymeta.productinfo.subcomponentname}: Changed: ") diff --git a/publish/do.groovy b/publish/do.groovy index 1b227f4..9f5bd21 100644 --- a/publish/do.groovy +++ b/publish/do.groovy @@ -60,7 +60,7 @@ gh = load("${autobuilder.commonscripts()}/versioncontrol/git.groovy") def getcomponentartifacts(releaseinfo, String repofolder, itempathstopublish) { summaryappend("Artifacts: ") - def releasemeta = releaseinfo.meta + def releasemeta = releaseinfo.metainfo def String componentURL = releasemeta.releaseinfo.releaserepoURL def String revision = "refs/tags/${releasemeta.buildstampinfo.buildstamp}_${releasemeta.jenkinsbuildinfo.buildnumber}" def publishableitems = releasemeta.publishableinfo @@ -113,7 +113,7 @@ def copydirectory(File dirFrom, File dirTo) { } def recallcomponent(String productline, releaseinfo, String softwarerelease, itempathstopublish) { - def releasemeta = releaseinfo.meta + def releasemeta = releaseinfo.metainfo def String uniquefolderforrepo = uniqueabsoluterreleasefolder(productline, releaserepofolder, softwarerelease, releasemeta) summaryappend("${releasemeta.productinfo.productname} ${releasemeta.productinfo.subcomponentname}: ") diff --git a/publish/publishitems.groovy b/publish/publishitems.groovy index 677970e..06e5fba 100644 --- a/publish/publishitems.groovy +++ b/publish/publishitems.groovy @@ -89,7 +89,7 @@ class PublishableItemsSelection { } def outputDescription(menuitems, releaseinfo) { - def meta = releaseinfo.meta + def meta = releaseinfo.metainfo for (publishableitem in meta.publishableinfo) { menuitems.add("${meta.productinfo.productname} ${meta.productinfo.subcomponentname} ${publishableitem.filepath}") @@ -97,7 +97,7 @@ class PublishableItemsSelection { } def outputSelection(menuitems, releaseinfo) { - def meta = releaseinfo.meta + def meta = releaseinfo.metainfo for (publishableitem in meta.publishableinfo) { menuitems.add("${meta.productinfo.productname}#${meta.productinfo.subcomponentname}#${publishableitem.filepath}") From 2a7e94b301eccd0dd89c159bf457a75768e1c436 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Fri, 17 Dec 2021 16:30:27 +0000 Subject: [PATCH 094/182] Debug components --- meta/folder.groovy | 1 + 1 file changed, 1 insertion(+) diff --git a/meta/folder.groovy b/meta/folder.groovy index 39b8d85..d5b6b7f 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -1089,6 +1089,7 @@ class MetaInfo extends GISJsonSerialised { ] def walkresults = allrelatedmeta() for (dependentmetaitem in walkresults.metacollection) { + script.echo("Comparing: ${dependentmetaitem.metainfo.productinfo.productname} ${dependentmetaitem.metainfo.productinfo.subcomponentname}") if (dependentmetaitem.metainfo.productinfo.productname == productname && dependentmetaitem.metainfo.productinfo.subcomponentname == subcomponentname) { script.echo("Found matching component: ${dependentmetaitem.metainfo.globalreleasetag()}") From d945efb8b76503a38d106fbe4f270e7b8c17c5ef Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Fri, 17 Dec 2021 16:53:24 +0000 Subject: [PATCH 095/182] Help the meta walker find the meta data for a child --- meta/folder.groovy | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/meta/folder.groovy b/meta/folder.groovy index d5b6b7f..c3db541 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -1029,9 +1029,9 @@ class MetaInfo extends GISJsonSerialised { return [ 'metacollection' : results.metacollection, 'comment': results.comment ] } - def allrelatedmeta() { + def allrelatedmeta(String metapath) { ArrayList metacollection = new ArrayList() - return walkrelated(metacollection) + return walkrelated(metacollection, '', 0, '', metapath) } ArrayList releasewalker(int maxdepth, String startpath = '', String startmetapath = '') { @@ -1082,12 +1082,12 @@ class MetaInfo extends GISJsonSerialised { return new MetaInfo(script) } - def findAssociatedMeta(String productname, String subcomponentname) { + def findAssociatedMeta(String parentmetapath, String productname, String subcomponentname) { def results = [ 'matchedmetaitem' : new CollectedMeta(this), 'matchfound' : false ] - def walkresults = allrelatedmeta() + def walkresults = allrelatedmeta(parentmetapath) for (dependentmetaitem in walkresults.metacollection) { script.echo("Comparing: ${dependentmetaitem.metainfo.productinfo.productname} ${dependentmetaitem.metainfo.productinfo.subcomponentname}") if (dependentmetaitem.metainfo.productinfo.productname == productname && From f554d5bd6ce258ed2f8623efc8d470b2ce0ef528 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Fri, 17 Dec 2021 17:01:19 +0000 Subject: [PATCH 096/182] Help the meta walker find the meta data for a child --- import/importer.groovy | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/import/importer.groovy b/import/importer.groovy index 0e2ca17..8ed4263 100644 --- a/import/importer.groovy +++ b/import/importer.groovy @@ -342,12 +342,12 @@ def artifactimport(meta, } // Import the artifacts of a named child component found below parent meta's hierarchy -def artifactimport(meta, parentmeta, String childproduct, String childsubcomponent, importoptions, String destinationfolder) { +def artifactimport(meta, parentmeta, String parentmetapath, String childproduct, String childsubcomponent, importoptions, String destinationfolder) { // Import from parent meta def childmeta = meta.getNewMetaObject() def childmeta2 echo "Finding meta associated with child: Product: ${childproduct} Sub-component: ${childsubcomponent}" - def findresults = parentmeta.findAssociatedMeta(childproduct, childsubcomponent) + def findresults = parentmeta.findAssociatedMeta(parentmetapath, childproduct, childsubcomponent) if (findresults.matchfound) { childmeta = findresults.matchedmeta if (childmeta.releaseinfo.released) { From 16061cfcc6950dcd5f1cd43e3afc8bef707efd3f Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Fri, 17 Dec 2021 17:11:49 +0000 Subject: [PATCH 097/182] Help the meta walker find the meta data for a child --- meta/folder.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta/folder.groovy b/meta/folder.groovy index c3db541..bffa75f 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -1031,7 +1031,7 @@ class MetaInfo extends GISJsonSerialised { def allrelatedmeta(String metapath) { ArrayList metacollection = new ArrayList() - return walkrelated(metacollection, '', 0, '', metapath) + return walkrelated(metacollection, '', 0, '', "${metapath}/${METAFOLDERNAME}") } ArrayList releasewalker(int maxdepth, String startpath = '', String startmetapath = '') { From 40054880d4ab1a4a9acbc54d3d60fca9f62c4c76 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Fri, 17 Dec 2021 17:39:58 +0000 Subject: [PATCH 098/182] Handle v0.1 imported associated meta --- meta/folder.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta/folder.groovy b/meta/folder.groovy index bffa75f..2b84781 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -1020,7 +1020,7 @@ class MetaInfo extends GISJsonSerialised { limiteddepth, maxdepth - 1) } - } else if (relatedmetainfo.format == '0.1') { + } else if (!relatedmetainfo.format || relatedmetainfo.format == '0.1') { def MetaInfo othermeta = relatedmetainfo.meta results = othermeta.walkrelated_v0_1(results.metacollection, results.comment, level + 1, gatheredpath, gatheredmetapath, limiteddepth, maxdepth - 1) } From d93eb4bc236d9be47c9082cc1fdcf17756d124fe Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Fri, 17 Dec 2021 18:03:19 +0000 Subject: [PATCH 099/182] Handle v0.1 imported associated meta --- meta/folder.groovy | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/meta/folder.groovy b/meta/folder.groovy index 2b84781..1c85658 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -600,10 +600,12 @@ class MetaInfo extends GISJsonSerialised { abstract class RelatedMetaInfo extends GISJsonSerialised implements IRelatedMetaInfo { private String format + private String offsetpath - RelatedMetaInfo(script, format) { + RelatedMetaInfo(script, format, offsetpath) { super(script) this.format = format + this.offsetpath = offsetpath } abstract void deserialiseJson(rawmeta) @@ -612,15 +614,17 @@ class MetaInfo extends GISJsonSerialised { String format() { return format } + + String getoffsetpath() { + return offsetpath + } } class RelatedMetaInfo_v0_1 extends RelatedMetaInfo { - String offsetpath - MetaInfo meta + private MetaInfo meta RelatedMetaInfo_v0_1(script, offsetpath = "", MetaInfo meta = null) { - super(script, '0.1') - this.offsetpath = offsetpath + super(script, '0.1', offsetpath) this.meta = meta } @@ -638,16 +642,16 @@ class MetaInfo extends GISJsonSerialised { ] return data } + + String get } class RelatedMetaInfo_v0_2 extends RelatedMetaInfo { private String importpath - private String offsetpath RelatedMetaInfo_v0_2(script, importpath = "", offsetpath = "") { - super(script, '0.2') + super(script, '0.2', offsetpath) this.importpath = importpath - this.offsetpath = offsetpath } void deserialiseJson(rawmeta) { @@ -1009,6 +1013,7 @@ class MetaInfo extends GISJsonSerialised { results.metacollection.add(new CollectedMeta(this, gatheredpath, gatheredmetapath)) results.comment += "${level} ".padRight(level * 4) + globalreleasetag() + '\n' for (relatedmetainfo in associatedmeta) { + script.echo("Related meta info: ${relatedmetainfo.offsetpath} format: ${relatedmetainfo.format}") if (relatedmetainfo.format == '0.2') { def childmetainfo = openchildmeta(gatheredpath, gatheredmetapath, relatedmetainfo) if (childmetainfo.imported) { From f09c84e5ec6404478eb92ae21c0ed0ad9e0d883e Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Fri, 17 Dec 2021 18:13:50 +0000 Subject: [PATCH 100/182] Handle v0.1 imported associated meta --- meta/folder.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta/folder.groovy b/meta/folder.groovy index 1c85658..7dd4521 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -600,7 +600,7 @@ class MetaInfo extends GISJsonSerialised { abstract class RelatedMetaInfo extends GISJsonSerialised implements IRelatedMetaInfo { private String format - private String offsetpath + protected String offsetpath RelatedMetaInfo(script, format, offsetpath) { super(script) From f44dc09dab4eb08b89c14298c0cc9032dd3ed355 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Fri, 17 Dec 2021 18:28:34 +0000 Subject: [PATCH 101/182] Handle v0.1 imported associated meta --- meta/folder.groovy | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/meta/folder.groovy b/meta/folder.groovy index 7dd4521..cccc456 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -600,7 +600,7 @@ class MetaInfo extends GISJsonSerialised { abstract class RelatedMetaInfo extends GISJsonSerialised implements IRelatedMetaInfo { private String format - protected String offsetpath + private String offsetpath RelatedMetaInfo(script, format, offsetpath) { super(script) @@ -618,6 +618,10 @@ class MetaInfo extends GISJsonSerialised { String getoffsetpath() { return offsetpath } + + void setoffsetoffsetpath(String offsetpath) { + this.offsetpath = offsetpath + } } class RelatedMetaInfo_v0_1 extends RelatedMetaInfo { @@ -629,7 +633,7 @@ class MetaInfo extends GISJsonSerialised { } void deserialiseJson(rawmeta) { - offsetpath = rawmeta['offsetpath'] + setoffsetoffsetpath(rawmeta['offsetpath']) meta = new MetaInfo(script) meta.deserialiseJson(rawmeta['meta']) } @@ -637,7 +641,7 @@ class MetaInfo extends GISJsonSerialised { LinkedHashMap serialisationdata() { def data = [ 'format' : format, - 'offsetpath' : offsetpath, + 'offsetpath' : getoffsetpath(), 'meta' : meta.serialisationdata(), ] return data @@ -656,13 +660,13 @@ class MetaInfo extends GISJsonSerialised { void deserialiseJson(rawmeta) { //format = rawmeta['format'] - offsetpath = rawmeta['offsetpath'] + setoffsetoffsetpath(rawmeta['offsetpath']) } LinkedHashMap serialisationdata() { def data = [ 'format' : format, - 'offsetpath' : offsetpath, + 'offsetpath' : getoffsetpath(), ] return data } From cd43ecf33aba1e6c91e492ac0984cc1b4069620e Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Fri, 17 Dec 2021 18:37:18 +0000 Subject: [PATCH 102/182] Handle v0.1 imported associated meta --- meta/folder.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta/folder.groovy b/meta/folder.groovy index cccc456..712795b 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -600,7 +600,7 @@ class MetaInfo extends GISJsonSerialised { abstract class RelatedMetaInfo extends GISJsonSerialised implements IRelatedMetaInfo { private String format - private String offsetpath + String offsetpath RelatedMetaInfo(script, format, offsetpath) { super(script) From 6e3c993d3e0c3f49f6f768a585c4a9864b09d4aa Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sat, 18 Dec 2021 18:02:11 +0000 Subject: [PATCH 103/182] Handle v0.1 imported associated meta --- meta/folder.groovy | 37 +++++++++++++++++++++++-------------- 1 file changed, 23 insertions(+), 14 deletions(-) diff --git a/meta/folder.groovy b/meta/folder.groovy index 712795b..0b6128b 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -600,32 +600,26 @@ class MetaInfo extends GISJsonSerialised { abstract class RelatedMetaInfo extends GISJsonSerialised implements IRelatedMetaInfo { private String format - String offsetpath RelatedMetaInfo(script, format, offsetpath) { super(script) this.format = format this.offsetpath = offsetpath } - - abstract void deserialiseJson(rawmeta) - abstract LinkedHashMap serialisationdata() String format() { return format } - String getoffsetpath() { - return offsetpath - } - - void setoffsetoffsetpath(String offsetpath) { - this.offsetpath = offsetpath - } + abstract void deserialiseJson(rawmeta) + abstract LinkedHashMap serialisationdata() + abstract String getoffsetpath() + abstract void setoffsetpath(String offsetpath) } class RelatedMetaInfo_v0_1 extends RelatedMetaInfo { private MetaInfo meta + private String offsetpath RelatedMetaInfo_v0_1(script, offsetpath = "", MetaInfo meta = null) { super(script, '0.1', offsetpath) @@ -633,7 +627,7 @@ class MetaInfo extends GISJsonSerialised { } void deserialiseJson(rawmeta) { - setoffsetoffsetpath(rawmeta['offsetpath']) + setoffsetpath(rawmeta['offsetpath']) meta = new MetaInfo(script) meta.deserialiseJson(rawmeta['meta']) } @@ -647,11 +641,18 @@ class MetaInfo extends GISJsonSerialised { return data } - String get + String getoffsetpath() { + return offsetpath + } + + void setoffsetpath(String offsetpath) { + this.offsetpath = offsetpath + } } class RelatedMetaInfo_v0_2 extends RelatedMetaInfo { private String importpath + private String offsetpath RelatedMetaInfo_v0_2(script, importpath = "", offsetpath = "") { super(script, '0.2', offsetpath) @@ -660,7 +661,7 @@ class MetaInfo extends GISJsonSerialised { void deserialiseJson(rawmeta) { //format = rawmeta['format'] - setoffsetoffsetpath(rawmeta['offsetpath']) + setoffsetpath(rawmeta['offsetpath']) } LinkedHashMap serialisationdata() { @@ -670,6 +671,14 @@ class MetaInfo extends GISJsonSerialised { ] return data } + + String getoffsetpath() { + return offsetpath + } + + void setoffsetpath(String offsetpath) { + this.offsetpath = offsetpath + } } private ProductInfo productinfo From 7e63a317c07b99a77ac76e3f3875f9601ee78388 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sat, 18 Dec 2021 18:21:30 +0000 Subject: [PATCH 104/182] Handle v0.1 imported associated meta --- meta/folder.groovy | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/meta/folder.groovy b/meta/folder.groovy index 0b6128b..76dae26 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -599,16 +599,11 @@ class MetaInfo extends GISJsonSerialised { } abstract class RelatedMetaInfo extends GISJsonSerialised implements IRelatedMetaInfo { - private String format + String format - RelatedMetaInfo(script, format, offsetpath) { + RelatedMetaInfo(script, format) { super(script) this.format = format - this.offsetpath = offsetpath - } - - String format() { - return format } abstract void deserialiseJson(rawmeta) @@ -622,7 +617,8 @@ class MetaInfo extends GISJsonSerialised { private String offsetpath RelatedMetaInfo_v0_1(script, offsetpath = "", MetaInfo meta = null) { - super(script, '0.1', offsetpath) + super(script, '0.1') + this.offsetpath = offsetpath this.meta = meta } @@ -655,8 +651,9 @@ class MetaInfo extends GISJsonSerialised { private String offsetpath RelatedMetaInfo_v0_2(script, importpath = "", offsetpath = "") { - super(script, '0.2', offsetpath) + super(script, '0.2') this.importpath = importpath + this.offsetpath = offsetpath } void deserialiseJson(rawmeta) { From 95506b8d8a6f045ce727e5a6c6c1c85f33b63f3d Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sat, 18 Dec 2021 18:26:02 +0000 Subject: [PATCH 105/182] Handle v0.1 imported associated meta --- meta/folder.groovy | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/meta/folder.groovy b/meta/folder.groovy index 76dae26..fc1e072 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -595,7 +595,8 @@ class MetaInfo extends GISJsonSerialised { interface IRelatedMetaInfo { abstract void deserialiseJson(rawmeta) abstract LinkedHashMap serialisationdata() - abstract String format() + abstract String getoffsetpath() + abstract void setoffsetpath(String offsetpath) } abstract class RelatedMetaInfo extends GISJsonSerialised implements IRelatedMetaInfo { From 25938cefe32f899ef876546625fe6688d7381d4c Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sat, 18 Dec 2021 18:34:36 +0000 Subject: [PATCH 106/182] Handle v0.1 imported associated meta --- meta/folder.groovy | 4 ---- 1 file changed, 4 deletions(-) diff --git a/meta/folder.groovy b/meta/folder.groovy index fc1e072..7016b0b 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -595,8 +595,6 @@ class MetaInfo extends GISJsonSerialised { interface IRelatedMetaInfo { abstract void deserialiseJson(rawmeta) abstract LinkedHashMap serialisationdata() - abstract String getoffsetpath() - abstract void setoffsetpath(String offsetpath) } abstract class RelatedMetaInfo extends GISJsonSerialised implements IRelatedMetaInfo { @@ -609,8 +607,6 @@ class MetaInfo extends GISJsonSerialised { abstract void deserialiseJson(rawmeta) abstract LinkedHashMap serialisationdata() - abstract String getoffsetpath() - abstract void setoffsetpath(String offsetpath) } class RelatedMetaInfo_v0_1 extends RelatedMetaInfo { From c76a1d68e51ad427a8f55871f93d50a2f299656e Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sat, 18 Dec 2021 18:51:19 +0000 Subject: [PATCH 107/182] Handle v0.1 imported associated meta --- meta/folder.groovy | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/meta/folder.groovy b/meta/folder.groovy index 7016b0b..1919d1b 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -620,7 +620,7 @@ class MetaInfo extends GISJsonSerialised { } void deserialiseJson(rawmeta) { - setoffsetpath(rawmeta['offsetpath']) + offsetpath = rawmeta['offsetpath'] meta = new MetaInfo(script) meta.deserialiseJson(rawmeta['meta']) } @@ -628,19 +628,11 @@ class MetaInfo extends GISJsonSerialised { LinkedHashMap serialisationdata() { def data = [ 'format' : format, - 'offsetpath' : getoffsetpath(), + 'offsetpath' : offsetpath, 'meta' : meta.serialisationdata(), ] return data } - - String getoffsetpath() { - return offsetpath - } - - void setoffsetpath(String offsetpath) { - this.offsetpath = offsetpath - } } class RelatedMetaInfo_v0_2 extends RelatedMetaInfo { @@ -655,24 +647,16 @@ class MetaInfo extends GISJsonSerialised { void deserialiseJson(rawmeta) { //format = rawmeta['format'] - setoffsetpath(rawmeta['offsetpath']) + offsetpath = rawmeta['offsetpath'] } LinkedHashMap serialisationdata() { def data = [ 'format' : format, - 'offsetpath' : getoffsetpath(), + 'offsetpath' : offsetpath, ] return data } - - String getoffsetpath() { - return offsetpath - } - - void setoffsetpath(String offsetpath) { - this.offsetpath = offsetpath - } } private ProductInfo productinfo From 670d7b22abadc922ada2f8e80538c7a3ada56661 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sat, 18 Dec 2021 19:22:20 +0000 Subject: [PATCH 108/182] Handle v0.1 imported associated meta --- import/importer.groovy | 2 +- meta/folder.groovy | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/import/importer.groovy b/import/importer.groovy index 8ed4263..39b31c6 100644 --- a/import/importer.groovy +++ b/import/importer.groovy @@ -349,7 +349,7 @@ def artifactimport(meta, parentmeta, String parentmetapath, String childproduct, echo "Finding meta associated with child: Product: ${childproduct} Sub-component: ${childsubcomponent}" def findresults = parentmeta.findAssociatedMeta(parentmetapath, childproduct, childsubcomponent) if (findresults.matchfound) { - childmeta = findresults.matchedmeta + childmeta = findresults.matchedmetaitem.metainfo if (childmeta.releaseinfo.released) { importoptions.releaserepo(childmeta.releaseinfo.releaserepoURL, childmeta.releasetag()) } else { diff --git a/meta/folder.groovy b/meta/folder.groovy index 1919d1b..e2a4cbd 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -1018,7 +1018,13 @@ class MetaInfo extends GISJsonSerialised { } } else if (!relatedmetainfo.format || relatedmetainfo.format == '0.1') { def MetaInfo othermeta = relatedmetainfo.meta - results = othermeta.walkrelated_v0_1(results.metacollection, results.comment, level + 1, gatheredpath, gatheredmetapath, limiteddepth, maxdepth - 1) + results = othermeta.walkrelated_v0_1(results.metacollection, + results.comment, + level + 1, + gatheredpath, + gatheredmetapath, + limiteddepth, + maxdepth - 1) } } } From 8e53968fbdfa588507b4d93c5a7f96e30d6077b6 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sat, 18 Dec 2021 20:38:30 +0000 Subject: [PATCH 109/182] Type parameters to archive method --- artifacts/archiver.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/artifacts/archiver.groovy b/artifacts/archiver.groovy index 78bee55..bafba02 100644 --- a/artifacts/archiver.groovy +++ b/artifacts/archiver.groovy @@ -6,7 +6,7 @@ enum Store { this.JENKINS = Store.JENKINS this.ARTIFACTSERVER = Store.JENKINS -def archive(meta, artifactlist, Store store = JENKINS ) { +def archive(MetaInfo meta, String artifactlist, Store store = JENKINS) { echo "Archiving artifacts to store: ${store}" meta.copyrelatedmeta() if (store == JENKINS) { From 1a111411353902deb9fc6ba76824559c501a2a4e Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sat, 18 Dec 2021 21:03:34 +0000 Subject: [PATCH 110/182] Type parameters to archive method --- meta/folder.groovy | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/meta/folder.groovy b/meta/folder.groovy index e2a4cbd..9ddeb7c 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -872,10 +872,10 @@ class MetaInfo extends GISJsonSerialised { return METAFOLDERNAME } - String generateartifacts(ArrayList releasedfromhere = new ArrayList(), // These items are recorded in meta as released from here - ArrayList releasedfromsubmeta = new ArrayList(), // These items are not recorded in meta as released from here - String metafilepath ="${METAFOLDERNAME}/${METAFILENAME}" - ) { + def String generateartifacts(ArrayList releasedfromhere = new ArrayList(), // These items are recorded in meta as released from here + ArrayList releasedfromsubmeta = new ArrayList(), // These items are not recorded in meta as released from here + String metafilepath ="${METAFOLDERNAME}/${METAFILENAME}" + ) { def String artifactlist = METAARTIFACTS releaseinfo.addReleaseItem(METAARTIFACTS) for (releaseitem in releasedfromhere) { From 0a0df4d88a2f7608002bb06ba2d21adc851017a7 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sun, 19 Dec 2021 13:23:20 +0000 Subject: [PATCH 111/182] Load module before cleaning --- copy/all.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/copy/all.groovy b/copy/all.groovy index 9b95eb6..0b7d862 100644 --- a/copy/all.groovy +++ b/copy/all.groovy @@ -54,6 +54,7 @@ pipeline { stage('Archiving artifacts') { steps { script { + artifactarchiver = load("${autobuilder.commonscripts()}/artifacts/archiver.groovy") def includes = '**/*' def excludes = "${IMPORTS}/*" echo "Archiving artifacts: Includes: ${includes} Excludes: ${excludes}" @@ -65,7 +66,6 @@ pipeline { 'autobuild', ] cleaner.clean(cleanfolders) - artifactarchiver = load("${autobuilder.commonscripts()}/artifacts/archiver.groovy") artifactarchiver.archive(artifacts: includes) } } From ab0d724399e4f476f584af9bfab18b40ba60c184 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sun, 19 Dec 2021 13:39:47 +0000 Subject: [PATCH 112/182] Load module before cleaning --- copy/all.groovy | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/copy/all.groovy b/copy/all.groovy index 0b7d862..920c80b 100644 --- a/copy/all.groovy +++ b/copy/all.groovy @@ -54,19 +54,15 @@ pipeline { stage('Archiving artifacts') { steps { script { - artifactarchiver = load("${autobuilder.commonscripts()}/artifacts/archiver.groovy") def includes = '**/*' def excludes = "${IMPORTS}/*" echo "Archiving artifacts: Includes: ${includes} Excludes: ${excludes}" - // This does not work: artifactarchiver = load("${autobuilder.commonscripts()}/artifacts/archiver.groovy") - // This does not work: artifactarchiver.archive(artifacts: includes, excludes: excludes) - // so cleanfolders = [ IMPORTS, 'autobuild', ] cleaner.clean(cleanfolders) - artifactarchiver.archive(artifacts: includes) + archiveArtifacts(artifacts: includes) } } } From 07a8a9d6a3059f250b058b7cf1e41e97dae7e625 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sun, 19 Dec 2021 18:21:23 +0000 Subject: [PATCH 113/182] Use indirect artifact archiver --- copy/all.groovy | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/copy/all.groovy b/copy/all.groovy index 920c80b..518f593 100644 --- a/copy/all.groovy +++ b/copy/all.groovy @@ -54,15 +54,19 @@ pipeline { stage('Archiving artifacts') { steps { script { - def includes = '**/*' + def artifacts = ['**/*'] + def artifactarchiver = load("${autobuilder.commonscripts()}/artifacts/archiver.groovy") + def artifactlist = meta.generateartifacts(artifacts) def excludes = "${IMPORTS}/*" - echo "Archiving artifacts: Includes: ${includes} Excludes: ${excludes}" + echo "Archiving artifacts: Includes: ${artifacts} Excludes: ${excludes}" + cleanfolders = [ IMPORTS, 'autobuild', ] cleaner.clean(cleanfolders) - archiveArtifacts(artifacts: includes) + + artifactarchiver.archive(meta, artifactlist) } } } From 6b35583fd2565683a197829f481c5521aef0af11 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sun, 19 Dec 2021 21:13:30 +0000 Subject: [PATCH 114/182] Use clean while moving imported info --- copy/all.groovy | 31 +++++++++++-------------------- copy/logic.groovy | 39 +++++++++++++++++++++++++-------------- 2 files changed, 36 insertions(+), 34 deletions(-) diff --git a/copy/all.groovy b/copy/all.groovy index 518f593..aab479c 100644 --- a/copy/all.groovy +++ b/copy/all.groovy @@ -5,6 +5,8 @@ pipeline { steps { script { meta = load("${WORKSPACE}/autobuild/Common_scripts/autobuilder.groovy").startnonbuild(this) + + importer = load("${autobuilder.commonscripts()}/import/importer.groovy") } } } @@ -23,7 +25,6 @@ pipeline { stage('Import source artifacts') { steps { script { - importer = load("${autobuilder.commonscripts()}/import/importer.groovy") def copyoptions = importer.getNewImportOptions() copyoptions.source( SOURCE_ARTIFACT_LOCATION, @@ -37,9 +38,14 @@ pipeline { } } } - stage('Copy source artifacts') { + stage('Archiving artifacts') { steps { script { + def artifactlist = meta.generateartifacts(['**/*']) + def artifactarchiver = load("${autobuilder.commonscripts()}/artifacts/archiver.groovy") + + cleaner.clean(['meta', 'autobuild']) + dir(IMPORTS) { fileOperations([ fileCopyOperation(excludes: '', @@ -48,23 +54,8 @@ pipeline { targetLocation: WORKSPACE) ]) } - } - } - } - stage('Archiving artifacts') { - steps { - script { - def artifacts = ['**/*'] - def artifactarchiver = load("${autobuilder.commonscripts()}/artifacts/archiver.groovy") - def artifactlist = meta.generateartifacts(artifacts) - def excludes = "${IMPORTS}/*" - echo "Archiving artifacts: Includes: ${artifacts} Excludes: ${excludes}" - - cleanfolders = [ - IMPORTS, - 'autobuild', - ] - cleaner.clean(cleanfolders) + + cleaner.clean([IMPORTS]) artifactarchiver.archive(meta, artifactlist) } @@ -85,4 +76,4 @@ pipeline { echo 'Succeeded build' } } -} \ No newline at end of file +} diff --git a/copy/logic.groovy b/copy/logic.groovy index 0a28a22..bf90a71 100644 --- a/copy/logic.groovy +++ b/copy/logic.groovy @@ -13,22 +13,25 @@ pipeline { stage('Clean exports') { steps { script { - env.LOGICDEST = "${WORKSPACE}/logic" + LOGICDEST = 'logic' cleanfolders = [ LOGICDEST, - "${WORKSPACE}/embedded_logic", ] cleaner = load("${autobuilder.commonscripts()}/clean/clean.groovy") cleaner.clean(cleanfolders) } } } - stage('Copying logic artifacts') { + stage('Import source artifacts') { steps { script { - sh('env') def logicoptions = importer.getNewImportOptions() - logicoptions.source(LOGIC_ARTIFACT_LOCATION, LOGIC_ARTIFACT_PROJECT, LOGIC_ARTIFACT_BUILD_SELECTOR, LOGIC_ARTIFACT_RELEASE_REPO, LOGIC_ARTIFACT_RELEASE_REVISION) + logicoptions.source( + LOGIC_ARTIFACT_LOCATION, + LOGIC_ARTIFACT_PROJECT, + LOGIC_ARTIFACT_BUILD_SELECTOR, + LOGIC_ARTIFACT_RELEASE_REPO, + LOGIC_ARTIFACT_RELEASE_REVISION) importer.artifactimport(meta, logicoptions, LOGICDEST) } } @@ -36,14 +39,22 @@ pipeline { stage('Archiving artifacts') { steps { script { - def artifactlist = meta.generateartifacts(["embedded_logic/**"]) - sh """ - rm -v -rf meta - # The following is removing a deprecated folder - rm -v -rf diff - mv -v "logic"/* . - """ - artifactarchiver = load("${autobuilder.commonscripts()}/artifacts/archiver.groovy") + def artifactlist = meta.generateartifacts(['**/*']) + def artifactarchiver = load("${autobuilder.commonscripts()}/artifacts/archiver.groovy") + + cleaner.clean(['meta', 'autobuild']) + + dir(LOGICDEST) { + fileOperations([ + fileCopyOperation(excludes: '', + flattenFiles: false, + includes: '**/*', + targetLocation: WORKSPACE) + ]) + } + + cleaner.clean([LOGICDEST]) + artifactarchiver.archive(meta, artifactlist) } } @@ -63,4 +74,4 @@ pipeline { echo 'Succeeded build' } } -} \ No newline at end of file +} From c3c7b802938939e255c81b15aa33c72fea169da0 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sun, 19 Dec 2021 21:43:27 +0000 Subject: [PATCH 115/182] Use clean while moving imported info --- copy/all.groovy | 2 ++ 1 file changed, 2 insertions(+) diff --git a/copy/all.groovy b/copy/all.groovy index aab479c..37a47e6 100644 --- a/copy/all.groovy +++ b/copy/all.groovy @@ -45,6 +45,8 @@ pipeline { def artifactarchiver = load("${autobuilder.commonscripts()}/artifacts/archiver.groovy") cleaner.clean(['meta', 'autobuild']) + + error('Debugging') dir(IMPORTS) { fileOperations([ From a06ac842b9a4ca4c03469eac9a7d56e3c6bbcf4d Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sun, 19 Dec 2021 21:45:33 +0000 Subject: [PATCH 116/182] Use clean while moving imported info --- copy/all.groovy | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/copy/all.groovy b/copy/all.groovy index 37a47e6..486a627 100644 --- a/copy/all.groovy +++ b/copy/all.groovy @@ -45,8 +45,6 @@ pipeline { def artifactarchiver = load("${autobuilder.commonscripts()}/artifacts/archiver.groovy") cleaner.clean(['meta', 'autobuild']) - - error('Debugging') dir(IMPORTS) { fileOperations([ @@ -57,6 +55,7 @@ pipeline { ]) } + error('Debugging') cleaner.clean([IMPORTS]) artifactarchiver.archive(meta, artifactlist) From d7893d9160ac5b0388a7f56f55a447ff05b67021 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sun, 19 Dec 2021 21:53:41 +0000 Subject: [PATCH 117/182] Use clean while moving imported info --- copy/all.groovy | 1 - 1 file changed, 1 deletion(-) diff --git a/copy/all.groovy b/copy/all.groovy index 486a627..aab479c 100644 --- a/copy/all.groovy +++ b/copy/all.groovy @@ -55,7 +55,6 @@ pipeline { ]) } - error('Debugging') cleaner.clean([IMPORTS]) artifactarchiver.archive(meta, artifactlist) From c9eb0c698c80a7e8c3c20cc1f9b3b10bbdc5e0f4 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Mon, 20 Dec 2021 13:52:31 +0000 Subject: [PATCH 118/182] Don't create folders for imported artifacts that don't have meta --- meta/folder.groovy | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/meta/folder.groovy b/meta/folder.groovy index 9ddeb7c..6e6767b 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -825,16 +825,15 @@ class MetaInfo extends GISJsonSerialised { if (script.fileExists(importedmetafile)) { script.echo("Deserialising meta at file: ${importedmetafile} (destpath: ${destpath})") mi.deserialiseJson(importedmetafile) + + RelatedMetaInfo rmi = new RelatedMetaInfo_v0_2(script, importedmetafile, adjustedpath) + if (appendtoparentmeta) { + associatedmeta.add(rmi) + } } else { script.echo("Could not deserialise meta at file: ${importedmetafile} (destpath: ${destpath})- Does not exist") mi.addConfigurationInfo('', givenRepo, givenRevision, givenSHA) } - - RelatedMetaInfo rmi = new RelatedMetaInfo_v0_2(script, importedmetafile, adjustedpath) - if (appendtoparentmeta) { - associatedmeta.add(rmi) - } - return mi } From 01d66c2d893609b513a78f7d75dedb7ac6820d99 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Mon, 20 Dec 2021 14:47:22 +0000 Subject: [PATCH 119/182] Don't create folders for imported artifacts that don't have meta --- meta/folder.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta/folder.groovy b/meta/folder.groovy index 6e6767b..f43237c 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -832,7 +832,7 @@ class MetaInfo extends GISJsonSerialised { } } else { script.echo("Could not deserialise meta at file: ${importedmetafile} (destpath: ${destpath})- Does not exist") - mi.addConfigurationInfo('', givenRepo, givenRevision, givenSHA) + addConfigurationInfo('', givenRepo, givenRevision, givenSHA) } return mi } From d3e5eb91acf81b01723fbc42111e1321b6f92461 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Mon, 20 Dec 2021 15:55:07 +0000 Subject: [PATCH 120/182] Correct build integrity checking --- meta/folder.groovy | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/meta/folder.groovy b/meta/folder.groovy index f43237c..96a37f8 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -1030,9 +1030,11 @@ class MetaInfo extends GISJsonSerialised { return [ 'metacollection' : results.metacollection, 'comment': results.comment ] } - def allrelatedmeta(String metapath) { + def allrelatedmeta(String metapath = '') { ArrayList metacollection = new ArrayList() - return walkrelated(metacollection, '', 0, '', "${metapath}/${METAFOLDERNAME}") + + def startmetapath = (metapath == '' ? METAFOLDERNAME : "${metapath}/${METAFOLDERNAME}") + return walkrelated(metacollection, '', 0, '', startmetapath) } ArrayList releasewalker(int maxdepth, String startpath = '', String startmetapath = '') { From 09b3c99bfe52c44397a813d8373cc80fa7d64bfd Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Mon, 20 Dec 2021 16:46:50 +0000 Subject: [PATCH 121/182] Correct initial gather paths --- meta/folder.groovy | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/meta/folder.groovy b/meta/folder.groovy index 96a37f8..e6bd3c5 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -923,18 +923,8 @@ class MetaInfo extends GISJsonSerialised { def openchildmeta(String gatheredpath, String gatheredmetapath, RelatedMetaInfo relatedmetainfo) { def MetaInfo mi = new MetaInfo(script) - def String nextgatheredpath - if (gatheredpath == '') { - nextgatheredpath = "${relatedmetainfo.offsetpath}" - } else { - nextgatheredpath = "${gatheredpath}/${relatedmetainfo.offsetpath}" - } - def String nextgatheredmetapath - if (gatheredmetapath == '') { - nextgatheredmetapath = "${relatedmetainfo.offsetpath}/${METAFOLDERNAME}" - } else { - nextgatheredmetapath = "${gatheredmetapath}/${relatedmetainfo.offsetpath}" - } + def String nextgatheredpath = (gatheredpath == '' ? relatedmetainfo.offsetpath : "${gatheredpath}/${relatedmetainfo.offsetpath}") + def String nextgatheredmetapath = (gatheredmetapath == '' ? "${relatedmetainfo.offsetpath}/${METAFOLDERNAME}" : "${gatheredmetapath}/${relatedmetainfo.offsetpath}" def importedmetafile = "${nextgatheredmetapath}/${METAFILENAME}" def boolean imported if (script.fileExists(importedmetafile)) { @@ -972,11 +962,13 @@ class MetaInfo extends GISJsonSerialised { for (relatedmetainfo in associatedmeta) { if (!relatedmetainfo.format || relatedmetainfo.format == '0.1') { def MetaInfo othermeta = relatedmetainfo.meta + def String nextgatheredpath = (gatheredpath == '' ? relatedmetainfo.offsetpath : "${gatheredpath}/${relatedmetainfo.offsetpath}") + def String nextgatheredmetapath = (gatheredmetapath == '' ? gatheredmetapath : "${gatheredmetapath}/${relatedmetainfo.offsetpath}") results = othermeta.walkrelated_v0_1(results.metacollection, results.comment, level + 1, - "${gatheredpath}/${relatedmetainfo.offsetpath}", - "${gatheredmetapath}/${relatedmetainfo.offsetpath}", + nextgatheredpath, + nextgatheredmetapath, limiteddepth, maxdepth - 1) } else { @@ -1032,9 +1024,7 @@ class MetaInfo extends GISJsonSerialised { def allrelatedmeta(String metapath = '') { ArrayList metacollection = new ArrayList() - - def startmetapath = (metapath == '' ? METAFOLDERNAME : "${metapath}/${METAFOLDERNAME}") - return walkrelated(metacollection, '', 0, '', startmetapath) + return walkrelated(metacollection, '', 0, '', metapath) } ArrayList releasewalker(int maxdepth, String startpath = '', String startmetapath = '') { From f171e520b7685d35acfd605b3f96dd99dc0cc946 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Mon, 20 Dec 2021 16:47:52 +0000 Subject: [PATCH 122/182] Correct initial gather paths --- meta/folder.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta/folder.groovy b/meta/folder.groovy index e6bd3c5..aa1d673 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -924,7 +924,7 @@ class MetaInfo extends GISJsonSerialised { def MetaInfo mi = new MetaInfo(script) def String nextgatheredpath = (gatheredpath == '' ? relatedmetainfo.offsetpath : "${gatheredpath}/${relatedmetainfo.offsetpath}") - def String nextgatheredmetapath = (gatheredmetapath == '' ? "${relatedmetainfo.offsetpath}/${METAFOLDERNAME}" : "${gatheredmetapath}/${relatedmetainfo.offsetpath}" + def String nextgatheredmetapath = (gatheredmetapath == '' ? "${relatedmetainfo.offsetpath}/${METAFOLDERNAME}" : "${gatheredmetapath}/${relatedmetainfo.offsetpath}") def importedmetafile = "${nextgatheredmetapath}/${METAFILENAME}" def boolean imported if (script.fileExists(importedmetafile)) { From 6053dbc4a93c847070dfde3524cdc10a95413956 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Mon, 20 Dec 2021 17:27:32 +0000 Subject: [PATCH 123/182] Correct initial gather paths --- meta/folder.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta/folder.groovy b/meta/folder.groovy index aa1d673..883e690 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -963,7 +963,7 @@ class MetaInfo extends GISJsonSerialised { if (!relatedmetainfo.format || relatedmetainfo.format == '0.1') { def MetaInfo othermeta = relatedmetainfo.meta def String nextgatheredpath = (gatheredpath == '' ? relatedmetainfo.offsetpath : "${gatheredpath}/${relatedmetainfo.offsetpath}") - def String nextgatheredmetapath = (gatheredmetapath == '' ? gatheredmetapath : "${gatheredmetapath}/${relatedmetainfo.offsetpath}") + def String nextgatheredmetapath = (gatheredmetapath == '' ? relatedmetainfo.offsetpath : "${gatheredmetapath}/${relatedmetainfo.offsetpath}") results = othermeta.walkrelated_v0_1(results.metacollection, results.comment, level + 1, From d5ecbe17d4948da2a8103046d68d269a938d7c8a Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Mon, 20 Dec 2021 23:01:03 +0000 Subject: [PATCH 124/182] Add log --- import/importer.groovy | 1 + 1 file changed, 1 insertion(+) diff --git a/import/importer.groovy b/import/importer.groovy index 39b31c6..0e88a21 100644 --- a/import/importer.groovy +++ b/import/importer.groovy @@ -347,6 +347,7 @@ def artifactimport(meta, parentmeta, String parentmetapath, String childproduct, def childmeta = meta.getNewMetaObject() def childmeta2 echo "Finding meta associated with child: Product: ${childproduct} Sub-component: ${childsubcomponent}" + echo "From Parent meta identifier: ${parentmeta.componentidentifier} and parent meta path: ${parentmetapath}" def findresults = parentmeta.findAssociatedMeta(parentmetapath, childproduct, childsubcomponent) if (findresults.matchfound) { childmeta = findresults.matchedmetaitem.metainfo From af70f7e083ecdec2812ce86b19d3245368b13612 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Mon, 20 Dec 2021 23:04:05 +0000 Subject: [PATCH 125/182] Add log --- import/importer.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/import/importer.groovy b/import/importer.groovy index 0e88a21..a35598c 100644 --- a/import/importer.groovy +++ b/import/importer.groovy @@ -347,7 +347,7 @@ def artifactimport(meta, parentmeta, String parentmetapath, String childproduct, def childmeta = meta.getNewMetaObject() def childmeta2 echo "Finding meta associated with child: Product: ${childproduct} Sub-component: ${childsubcomponent}" - echo "From Parent meta identifier: ${parentmeta.componentidentifier} and parent meta path: ${parentmetapath}" + echo "From Parent meta identifier: ${parentmeta.componentidentifier()} and parent meta path: ${parentmetapath}" def findresults = parentmeta.findAssociatedMeta(parentmetapath, childproduct, childsubcomponent) if (findresults.matchfound) { childmeta = findresults.matchedmetaitem.metainfo From 4b3e84c72d851b2ed499558d02b72dc26aa41f23 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Mon, 20 Dec 2021 23:14:41 +0000 Subject: [PATCH 126/182] Alter path to start finding --- import/importer.groovy | 2 +- meta/folder.groovy | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/import/importer.groovy b/import/importer.groovy index a35598c..8bb565a 100644 --- a/import/importer.groovy +++ b/import/importer.groovy @@ -347,7 +347,7 @@ def artifactimport(meta, parentmeta, String parentmetapath, String childproduct, def childmeta = meta.getNewMetaObject() def childmeta2 echo "Finding meta associated with child: Product: ${childproduct} Sub-component: ${childsubcomponent}" - echo "From Parent meta identifier: ${parentmeta.componentidentifier()} and parent meta path: ${parentmetapath}" + echo "From parent meta identifier: ${parentmeta.componentidentifier()} and parent meta path: ${parentmetapath}" def findresults = parentmeta.findAssociatedMeta(parentmetapath, childproduct, childsubcomponent) if (findresults.matchfound) { childmeta = findresults.matchedmetaitem.metainfo diff --git a/meta/folder.groovy b/meta/folder.groovy index 883e690..f72b502 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -1080,7 +1080,7 @@ class MetaInfo extends GISJsonSerialised { 'matchedmetaitem' : new CollectedMeta(this), 'matchfound' : false ] - def walkresults = allrelatedmeta(parentmetapath) + def walkresults = allrelatedmeta("${parentmetapath}/${METAFOLDERNAME}") for (dependentmetaitem in walkresults.metacollection) { script.echo("Comparing: ${dependentmetaitem.metainfo.productinfo.productname} ${dependentmetaitem.metainfo.productinfo.subcomponentname}") if (dependentmetaitem.metainfo.productinfo.productname == productname && From ebb151dceaa14f4ab1f8c8d513d15f557a771c10 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 21 Dec 2021 16:10:31 +0000 Subject: [PATCH 127/182] Add a unique id to each product --- meta/folder.groovy | 35 ++++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/meta/folder.groovy b/meta/folder.groovy index f72b502..071ec9d 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -24,16 +24,18 @@ class ProductInfo extends GISJsonSerialised { private String productname private String subcomponentname private String variant + private String uniqueid - ProductInfo(script, productname = "", subcomponentname = "", variant = "") { + ProductInfo(script, String productname = '', String subcomponentname = '', String variant = '') { super(script) this.format = '0.1' this.productname = productname this.subcomponentname = subcomponentname this.variant = variant + this.uniqueid = UUID.randomUUID().toString() } - void set(String productname, String subcomponentname, String variant = '') { + void set(String productname, String subcomponentname, String variant = '', ) { // Make sure the fields can be used in git tags def int pstatus = 0 if (script.isUnix()) { @@ -76,13 +78,15 @@ class ProductInfo extends GISJsonSerialised { this.productname = otherinfo.productname this.subcomponentname = otherinfo.subcomponentname this.variant = otherinfo.variant + this.uniqueid = otherinfo.uniqueid } void deserialiseJson(rawmeta) { //format = rawmeta['format'] productname = rawmeta['productname'] subcomponentname = rawmeta['subcomponentname'] - variant = rawmeta['variant'] ?: "" + variant = rawmeta['variant'] ?: '' + uniqueid = rawmeta['uniqueid'] ?: uniqueid } LinkedHashMap serialisationdata() { @@ -91,6 +95,7 @@ class ProductInfo extends GISJsonSerialised { 'productname' : productname, 'subcomponentname' : subcomponentname, 'variant' : variant, + 'uniqueid': uniqueid, ] return data } @@ -104,7 +109,7 @@ class GitInfo extends GISJsonSerialised { private String remoteurl private String remoteinfo - GitInfo(script, sourcepath = "", sourcerevision = "", gitrevision = "", remoteurl = "", remoteinfo = "") { + GitInfo(script, sourcepath = '', sourcerevision = '', gitrevision = '', remoteurl = '', remoteinfo = '') { super(script) this.format = '0.1' this.sourcepath = sourcepath @@ -204,7 +209,7 @@ class JenkinsBuildInfo extends GISJsonSerialised { private ArrayList parameters private boolean isfullbuild - JenkinsBuildInfo(script, String buildjobname = "", int buildnumber = 0, String buildmachine = "", String builddate = "", boolean isfullbuild = true) { + JenkinsBuildInfo(script, String buildjobname = '', int buildnumber = 0, String buildmachine = '', String builddate = '', boolean isfullbuild = true) { super(script) this.format = '0.1' this.buildjobname = buildjobname @@ -370,7 +375,7 @@ class ReleaseInfo extends GISJsonSerialised { private ArrayList releaseitems private boolean released - ReleaseInfo(script, String releaserepoURL = "", boolean released = false) { + ReleaseInfo(script, String releaserepoURL = '', boolean released = false) { super(script) this.format = '0.1' this.releaserepoURL = releaserepoURL @@ -378,7 +383,7 @@ class ReleaseInfo extends GISJsonSerialised { this.released = released } - void set(String releaserepoURL = "") { + void set(String releaserepoURL = '') { this.releaserepoURL = releaserepoURL } @@ -426,7 +431,7 @@ class ConfigurationInfo extends GISJsonSerialised { private String configurationversion private String configurationSHA - ConfigurationInfo(script, configurationname = "", configurationURL = "", configurationversion = "", configurationSHA = "") { + ConfigurationInfo(script, configurationname = '', configurationURL = '', configurationversion = '', configurationSHA = '') { super(script) this.configurationname = configurationname this.configurationURL = configurationURL @@ -456,7 +461,7 @@ class ChecksumPair extends GISJsonSerialised { private String filepath private String sum - ChecksumPair(script, String filepath = "", String sum = "") { + ChecksumPair(script, String filepath = '', String sum = '') { super(script) this.filepath = filepath this.sum = sum @@ -481,7 +486,7 @@ class ChecksumSet extends GISJsonSerialised { private String artifactpath private ArrayList checksumpairs - ChecksumSet(script, artifactpath = "") { + ChecksumSet(script, artifactpath = '') { super(script) this.format = '0.1' this.artifactpath = artifactpath @@ -566,7 +571,7 @@ class PublishableInfo extends GISJsonSerialised { private String format private String filepath - PublishableInfo(script, String filepath = "") { + PublishableInfo(script, String filepath = '') { super(script) this.format = '0.1' this.filepath = filepath @@ -613,7 +618,7 @@ class MetaInfo extends GISJsonSerialised { private MetaInfo meta private String offsetpath - RelatedMetaInfo_v0_1(script, offsetpath = "", MetaInfo meta = null) { + RelatedMetaInfo_v0_1(script, offsetpath = '', MetaInfo meta = null) { super(script, '0.1') this.offsetpath = offsetpath this.meta = meta @@ -639,7 +644,7 @@ class MetaInfo extends GISJsonSerialised { private String importpath private String offsetpath - RelatedMetaInfo_v0_2(script, importpath = "", offsetpath = "") { + RelatedMetaInfo_v0_2(script, importpath = '', offsetpath = '') { super(script, '0.2') this.importpath = importpath this.offsetpath = offsetpath @@ -1106,13 +1111,13 @@ MetaInfo metareset(script) { return mi } -MetaInfo metafromfolder(String folder = "") { +MetaInfo metafromfolder(String folder = '') { MetaInfo buildmeta = new MetaInfo(this) buildmeta.deserialiseJson("${folder}/${MetaInfo.metafilepath()}") return buildmeta } -MetaInfo metafromfolderSlurper(String folder = "") { +MetaInfo metafromfolderSlurper(String folder = '') { MetaInfo buildmeta = new MetaInfo(this) buildmeta.deserialiseJsonSlurper("${folder}/${MetaInfo.metafilepath()}") return buildmeta From 71a3a926722ab833fe54cd9c5f73f04476f29c94 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 21 Dec 2021 16:12:21 +0000 Subject: [PATCH 128/182] Add a unique id to each product --- meta/folder.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta/folder.groovy b/meta/folder.groovy index 071ec9d..4193f7e 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -35,7 +35,7 @@ class ProductInfo extends GISJsonSerialised { this.uniqueid = UUID.randomUUID().toString() } - void set(String productname, String subcomponentname, String variant = '', ) { + void set(String productname, String subcomponentname, String variant = '') { // Make sure the fields can be used in git tags def int pstatus = 0 if (script.isUnix()) { From 902ec6591ad3e778a04956124a7ae6f0408bc516 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 21 Dec 2021 17:14:26 +0000 Subject: [PATCH 129/182] Use an iteration variable in walker --- meta/folder.groovy | 143 +++++++++++++++++++++++++-------------------- 1 file changed, 80 insertions(+), 63 deletions(-) diff --git a/meta/folder.groovy b/meta/folder.groovy index 4193f7e..163ff2a 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -925,11 +925,41 @@ class MetaInfo extends GISJsonSerialised { } } - def openchildmeta(String gatheredpath, String gatheredmetapath, RelatedMetaInfo relatedmetainfo) { + class IterationInfo { + private ArrayList metacollection + private String comment + private int level + private String gatheredpath + private String gatheredmetapath + private boolean limiteddepth + private int maxdepth + + IterationInfo(ArrayList metacollection = new ArrayList(), + String comment = '', + int level = 0, + String gatheredpath = '', + String gatheredmetapath = '', + boolean limiteddepth = false, + int maxdepth = 0) { + this.metacollection = metacollection + this.comment = comment + this.level = level + this.gatheredpath = gatheredpath + this.gatheredmetapath = gatheredmetapath + this.limiteddepth = limiteddepth + this.maxdepth = maxdepth + } + + String show() { + return "Iteration:\nLevel: ${level}\nGathered path: ${gatheredpath}\nGathered meta path: ${gatheredmetapath}\nLimited depth: ${limiteddepth}\nMax depth: ${maxdepth}" + } + } + + def openchildmeta(IterationInfo ii, RelatedMetaInfo relatedmetainfo) { def MetaInfo mi = new MetaInfo(script) - def String nextgatheredpath = (gatheredpath == '' ? relatedmetainfo.offsetpath : "${gatheredpath}/${relatedmetainfo.offsetpath}") - def String nextgatheredmetapath = (gatheredmetapath == '' ? "${relatedmetainfo.offsetpath}/${METAFOLDERNAME}" : "${gatheredmetapath}/${relatedmetainfo.offsetpath}") + def String nextgatheredpath = (ii.gatheredpath == '' ? relatedmetainfo.offsetpath : "${ii.gatheredpath}/${relatedmetainfo.offsetpath}") + def String nextgatheredmetapath = (ii.gatheredmetapath == '' ? "${relatedmetainfo.offsetpath}/${METAFOLDERNAME}" : "${ii.gatheredmetapath}/${relatedmetainfo.offsetpath}") def importedmetafile = "${nextgatheredmetapath}/${METAFILENAME}" def boolean imported if (script.fileExists(importedmetafile)) { @@ -949,92 +979,79 @@ class MetaInfo extends GISJsonSerialised { return childmetainfo } - def walkrelated_v0_1(ArrayList metacollection, - String comment = '', - int level = 0, - String gatheredpath = '', - String gatheredmetapath = '', - boolean limiteddepth = false, - int maxdepth = 0) { - script.echo("walkrelated_v0_1 Iteration:\nLevel: ${level}\nGathered path: ${gatheredpath}\nGathered meta path: ${gatheredmetapath}\nLimited depth: ${limiteddepth}\nMax depth: ${maxdepth}") - def results = [ - 'metacollection' : metacollection, - 'comment': comment - ] - if (!limiteddepth || maxdepth > 0) { - results.metacollection.add(new CollectedMeta(this, gatheredpath, gatheredmetapath)) - results.comment += "${level} ".padRight(level * 4) + globalreleasetag() + '\n' + def walkrelated_v0_1(IterationInfo ii) { + script.echo("Walk related v0.1: ${ii.show()}") + if (!ii.limiteddepth || ii.maxdepth > 0) { + ii.metacollection.add(new CollectedMeta(this, ii.gatheredpath, ii.gatheredmetapath)) + ii.comment += "${ii.level} ".padRight(ii.level * 4) + globalreleasetag() + '\n' for (relatedmetainfo in associatedmeta) { if (!relatedmetainfo.format || relatedmetainfo.format == '0.1') { def MetaInfo othermeta = relatedmetainfo.meta - def String nextgatheredpath = (gatheredpath == '' ? relatedmetainfo.offsetpath : "${gatheredpath}/${relatedmetainfo.offsetpath}") - def String nextgatheredmetapath = (gatheredmetapath == '' ? relatedmetainfo.offsetpath : "${gatheredmetapath}/${relatedmetainfo.offsetpath}") - results = othermeta.walkrelated_v0_1(results.metacollection, - results.comment, - level + 1, - nextgatheredpath, - nextgatheredmetapath, - limiteddepth, - maxdepth - 1) + def String nextgatheredpath = (ii.gatheredpath == '' ? relatedmetainfo.offsetpath : "${ii.gatheredpath}/${relatedmetainfo.offsetpath}") + def String nextgatheredmetapath = (ii.gatheredmetapath == '' ? relatedmetainfo.offsetpath : "${ii.gatheredmetapath}/${relatedmetainfo.offsetpath}") + def nextii = new IterationInfo(ii.metacollection, + ii.comment, + ii.level + 1, + nextgatheredpath, + nextgatheredmetapath, + ii.limiteddepth + ii.maxdepth - 1) + def results = othermeta.walkrelated_v0_1(nextii) + ii.metacollection = results.metacollection + ii.comment = results.comment } else { script.error("There is non v0.1 format related meta info under v0.1 related meta info") } } } - return [ 'metacollection' : results.metacollection, 'comment': results.comment ] + return [ 'metacollection' : ii.metacollection, 'comment': ii.comment ] } - def walkrelated(ArrayList metacollection, - String comment = '', - int level = 0, - String gatheredpath = '', - String gatheredmetapath = '', - boolean limiteddepth = false, - int maxdepth = 0) { - script.echo("walkrelated Iteration:\nLevel: ${level}\nGathered path: ${gatheredpath}\nGathered meta path: ${gatheredmetapath}\nLimited depth: ${limiteddepth}\nMax depth: ${maxdepth}") - def results = [ - 'metacollection' : metacollection, - 'comment': comment - ] - if (!limiteddepth || maxdepth > 0) { - results.metacollection.add(new CollectedMeta(this, gatheredpath, gatheredmetapath)) - results.comment += "${level} ".padRight(level * 4) + globalreleasetag() + '\n' + def walkrelated(IterationInfo ii) { + script.echo("Walk related: ${ii.show()}") + if (!ii.limiteddepth || ii.maxdepth > 0) { + ii.metacollection.add(new CollectedMeta(this, ii.gatheredpath, ii.gatheredmetapath)) + ii.comment += "${ii.level} ".padRight(ii.level * 4) + globalreleasetag() + '\n' for (relatedmetainfo in associatedmeta) { script.echo("Related meta info: ${relatedmetainfo.offsetpath} format: ${relatedmetainfo.format}") if (relatedmetainfo.format == '0.2') { - def childmetainfo = openchildmeta(gatheredpath, gatheredmetapath, relatedmetainfo) + def childmetainfo = openchildmeta(ii, relatedmetainfo) if (childmetainfo.imported) { - results = childmetainfo.childmeta.walkrelated(results.metacollection, - results.comment, - level + 1, - childmetainfo.nextgatheredpath, - childmetainfo.nextgatheredmetapath, - limiteddepth, - maxdepth - 1) + def nextii = new IterationInfo(ii.metacollection, + ii.comment, + ii.level + 1, + childmetainfo.nextgatheredpath, + childmetainfo.nextgatheredmetapath, + ii.limiteddepth + ii.maxdepth - 1) + def results = childmetainfo.childmeta.walkrelated(nextii) + ii.metacollection = results.metacollection + ii.comment = results.comment } } else if (!relatedmetainfo.format || relatedmetainfo.format == '0.1') { def MetaInfo othermeta = relatedmetainfo.meta - results = othermeta.walkrelated_v0_1(results.metacollection, - results.comment, - level + 1, - gatheredpath, - gatheredmetapath, - limiteddepth, - maxdepth - 1) + def nextii = new IterationInfo(ii.metacollection, + ii.comment, + ii.level + 1, + ii.gatheredpath, + ii.gatheredmetapath, + ii.limiteddepth + ii.maxdepth - 1) + def results = othermeta.walkrelated_v0_1(nextii) + ii.metacollection = results.metacollection + ii.comment = results.comment } } } - return [ 'metacollection' : results.metacollection, 'comment': results.comment ] + return [ 'metacollection' : ii.metacollection, 'comment': ii.comment ] } def allrelatedmeta(String metapath = '') { - ArrayList metacollection = new ArrayList() - return walkrelated(metacollection, '', 0, '', metapath) + return walkrelated(new IterationInfo(metacollection, '', 0, '', metapath)) } ArrayList releasewalker(int maxdepth, String startpath = '', String startmetapath = '') { - def ArrayList metacollection = new ArrayList() - def results = walkrelated(metacollection, 'meta', 0, startpath, startmetapath, true, maxdepth) + def results = walkrelated(new IterationInfo(metacollection, 'meta', 0, startpath, startmetapath, true, maxdepth)) return results.metacollection } From bfb7d9fa4c96196dd7e532b4469bd4b149776656 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 21 Dec 2021 17:17:36 +0000 Subject: [PATCH 130/182] Use an iteration variable in walker --- meta/folder.groovy | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/meta/folder.groovy b/meta/folder.groovy index 163ff2a..71277e5 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -994,7 +994,7 @@ class MetaInfo extends GISJsonSerialised { ii.level + 1, nextgatheredpath, nextgatheredmetapath, - ii.limiteddepth + ii.limiteddepth, ii.maxdepth - 1) def results = othermeta.walkrelated_v0_1(nextii) ii.metacollection = results.metacollection @@ -1022,7 +1022,7 @@ class MetaInfo extends GISJsonSerialised { ii.level + 1, childmetainfo.nextgatheredpath, childmetainfo.nextgatheredmetapath, - ii.limiteddepth + ii.limiteddepth, ii.maxdepth - 1) def results = childmetainfo.childmeta.walkrelated(nextii) ii.metacollection = results.metacollection @@ -1035,7 +1035,7 @@ class MetaInfo extends GISJsonSerialised { ii.level + 1, ii.gatheredpath, ii.gatheredmetapath, - ii.limiteddepth + ii.limiteddepth, ii.maxdepth - 1) def results = othermeta.walkrelated_v0_1(nextii) ii.metacollection = results.metacollection From 0122ee498c220a9213ab1cc4e038c946b5debdac Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 21 Dec 2021 17:26:36 +0000 Subject: [PATCH 131/182] Use an iteration variable in walker --- meta/folder.groovy | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/meta/folder.groovy b/meta/folder.groovy index 71277e5..e29f8ff 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -927,6 +927,7 @@ class MetaInfo extends GISJsonSerialised { class IterationInfo { private ArrayList metacollection + private Map() metamap private String comment private int level private String gatheredpath @@ -935,6 +936,7 @@ class MetaInfo extends GISJsonSerialised { private int maxdepth IterationInfo(ArrayList metacollection = new ArrayList(), + Map metamap = new Map(), String comment = '', int level = 0, String gatheredpath = '', @@ -942,6 +944,7 @@ class MetaInfo extends GISJsonSerialised { boolean limiteddepth = false, int maxdepth = 0) { this.metacollection = metacollection + this.metamap = metamap this.comment = comment this.level = level this.gatheredpath = gatheredpath @@ -990,6 +993,7 @@ class MetaInfo extends GISJsonSerialised { def String nextgatheredpath = (ii.gatheredpath == '' ? relatedmetainfo.offsetpath : "${ii.gatheredpath}/${relatedmetainfo.offsetpath}") def String nextgatheredmetapath = (ii.gatheredmetapath == '' ? relatedmetainfo.offsetpath : "${ii.gatheredmetapath}/${relatedmetainfo.offsetpath}") def nextii = new IterationInfo(ii.metacollection, + ii.metamap, ii.comment, ii.level + 1, nextgatheredpath, @@ -1018,6 +1022,7 @@ class MetaInfo extends GISJsonSerialised { def childmetainfo = openchildmeta(ii, relatedmetainfo) if (childmetainfo.imported) { def nextii = new IterationInfo(ii.metacollection, + ii.metamap, ii.comment, ii.level + 1, childmetainfo.nextgatheredpath, @@ -1031,6 +1036,7 @@ class MetaInfo extends GISJsonSerialised { } else if (!relatedmetainfo.format || relatedmetainfo.format == '0.1') { def MetaInfo othermeta = relatedmetainfo.meta def nextii = new IterationInfo(ii.metacollection, + ii.metamap, ii.comment, ii.level + 1, ii.gatheredpath, @@ -1046,12 +1052,13 @@ class MetaInfo extends GISJsonSerialised { return [ 'metacollection' : ii.metacollection, 'comment': ii.comment ] } - def allrelatedmeta(String metapath = '') { - return walkrelated(new IterationInfo(metacollection, '', 0, '', metapath)) + def allrelatedmeta(String metapath = '') {, + Map metamap = + return walkrelated(new IterationInfo(new ArrayList(), new Map(), '', 0, '', metapath)) } ArrayList releasewalker(int maxdepth, String startpath = '', String startmetapath = '') { - def results = walkrelated(new IterationInfo(metacollection, 'meta', 0, startpath, startmetapath, true, maxdepth)) + def results = walkrelated(new IterationInfo(new ArrayList(), new Map(), 'meta', 0, startpath, startmetapath, true, maxdepth)) return results.metacollection } From 72b5f6de79a844fec715fba67bc3decc0e738253 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 21 Dec 2021 17:30:16 +0000 Subject: [PATCH 132/182] Use an iteration variable in walker --- meta/folder.groovy | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/meta/folder.groovy b/meta/folder.groovy index e29f8ff..f8f7cd2 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -927,7 +927,7 @@ class MetaInfo extends GISJsonSerialised { class IterationInfo { private ArrayList metacollection - private Map() metamap + private Map metamap private String comment private int level private String gatheredpath @@ -1002,13 +1002,14 @@ class MetaInfo extends GISJsonSerialised { ii.maxdepth - 1) def results = othermeta.walkrelated_v0_1(nextii) ii.metacollection = results.metacollection + ii.metamap = results.metamap ii.comment = results.comment } else { script.error("There is non v0.1 format related meta info under v0.1 related meta info") } } } - return [ 'metacollection' : ii.metacollection, 'comment': ii.comment ] + return [ 'metacollection' : ii.metacollection, 'metamap' : ii.metamap, 'comment': ii.comment ] } def walkrelated(IterationInfo ii) { @@ -1031,6 +1032,7 @@ class MetaInfo extends GISJsonSerialised { ii.maxdepth - 1) def results = childmetainfo.childmeta.walkrelated(nextii) ii.metacollection = results.metacollection + ii.metamap = results.metamap ii.comment = results.comment } } else if (!relatedmetainfo.format || relatedmetainfo.format == '0.1') { @@ -1045,11 +1047,12 @@ class MetaInfo extends GISJsonSerialised { ii.maxdepth - 1) def results = othermeta.walkrelated_v0_1(nextii) ii.metacollection = results.metacollection + ii.metamap = results.metamap ii.comment = results.comment } } } - return [ 'metacollection' : ii.metacollection, 'comment': ii.comment ] + return [ 'metacollection' : ii.metacollection, 'metamap' : ii.metamap, 'comment': ii.comment ] } def allrelatedmeta(String metapath = '') {, From fd8a3824bd51dca279f02e37b5d703a42de9c150 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 21 Dec 2021 17:35:42 +0000 Subject: [PATCH 133/182] Use an iteration variable in walker --- meta/folder.groovy | 1 - 1 file changed, 1 deletion(-) diff --git a/meta/folder.groovy b/meta/folder.groovy index f8f7cd2..7046bcf 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -1056,7 +1056,6 @@ class MetaInfo extends GISJsonSerialised { } def allrelatedmeta(String metapath = '') {, - Map metamap = return walkrelated(new IterationInfo(new ArrayList(), new Map(), '', 0, '', metapath)) } From 345d6f2e8ce4f67d0108d972bfb720575cb017f4 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 21 Dec 2021 17:36:45 +0000 Subject: [PATCH 134/182] Use an iteration variable in walker --- meta/folder.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta/folder.groovy b/meta/folder.groovy index 7046bcf..e1549fd 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -1055,7 +1055,7 @@ class MetaInfo extends GISJsonSerialised { return [ 'metacollection' : ii.metacollection, 'metamap' : ii.metamap, 'comment': ii.comment ] } - def allrelatedmeta(String metapath = '') {, + def allrelatedmeta(String metapath = '') { return walkrelated(new IterationInfo(new ArrayList(), new Map(), '', 0, '', metapath)) } From 904e2cc20fa6228c2cddd16d47c4b16f768a3eb5 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 21 Dec 2021 17:41:59 +0000 Subject: [PATCH 135/182] Use an iteration variable in walker --- meta/folder.groovy | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/meta/folder.groovy b/meta/folder.groovy index e1549fd..ac8fa23 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -935,8 +935,8 @@ class MetaInfo extends GISJsonSerialised { private boolean limiteddepth private int maxdepth - IterationInfo(ArrayList metacollection = new ArrayList(), - Map metamap = new Map(), + IterationInfo(ArrayList metacollection, + Map metamap, String comment = '', int level = 0, String gatheredpath = '', @@ -1056,11 +1056,15 @@ class MetaInfo extends GISJsonSerialised { } def allrelatedmeta(String metapath = '') { - return walkrelated(new IterationInfo(new ArrayList(), new Map(), '', 0, '', metapath)) + def ArrayList metacollection = new ArrayList() + def Map metamap = new Map() + return walkrelated(new IterationInfo(metacollection, metamap, '', 0, '', metapath)) } ArrayList releasewalker(int maxdepth, String startpath = '', String startmetapath = '') { - def results = walkrelated(new IterationInfo(new ArrayList(), new Map(), 'meta', 0, startpath, startmetapath, true, maxdepth)) + def ArrayList metacollection = new ArrayList() + def Map metamap = new Map() + def results = walkrelated(new IterationInfo(metacollection, metamap, 'meta', 0, startpath, startmetapath, true, maxdepth)) return results.metacollection } From 27298b99745681a7cc3ccd4b47620aeda8247b42 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 21 Dec 2021 17:44:28 +0000 Subject: [PATCH 136/182] Use an iteration variable in walker --- meta/folder.groovy | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meta/folder.groovy b/meta/folder.groovy index ac8fa23..8325a89 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -1057,13 +1057,13 @@ class MetaInfo extends GISJsonSerialised { def allrelatedmeta(String metapath = '') { def ArrayList metacollection = new ArrayList() - def Map metamap = new Map() + def Map metamap = new LinkedHashMap() return walkrelated(new IterationInfo(metacollection, metamap, '', 0, '', metapath)) } ArrayList releasewalker(int maxdepth, String startpath = '', String startmetapath = '') { def ArrayList metacollection = new ArrayList() - def Map metamap = new Map() + def Map metamap = new LinkedHashMap() def results = walkrelated(new IterationInfo(metacollection, metamap, 'meta', 0, startpath, startmetapath, true, maxdepth)) return results.metacollection } From f21873bfcec1493c700023b7717a2186cef14014 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 21 Dec 2021 18:21:37 +0000 Subject: [PATCH 137/182] Optimise reading in of meta from files --- meta/folder.groovy | 41 +++++++++++++++++++++++++++++++++++------ 1 file changed, 35 insertions(+), 6 deletions(-) diff --git a/meta/folder.groovy b/meta/folder.groovy index 8325a89..5861293 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -600,6 +600,7 @@ class MetaInfo extends GISJsonSerialised { interface IRelatedMetaInfo { abstract void deserialiseJson(rawmeta) abstract LinkedHashMap serialisationdata() + abstract String getuniqueid() } abstract class RelatedMetaInfo extends GISJsonSerialised implements IRelatedMetaInfo { @@ -612,20 +613,24 @@ class MetaInfo extends GISJsonSerialised { abstract void deserialiseJson(rawmeta) abstract LinkedHashMap serialisationdata() + abstract String getuniqueid() } class RelatedMetaInfo_v0_1 extends RelatedMetaInfo { private MetaInfo meta private String offsetpath + private String uniqueid - RelatedMetaInfo_v0_1(script, offsetpath = '', MetaInfo meta = null) { + RelatedMetaInfo_v0_1(script, String offsetpath = '', MetaInfo meta = null, String uniqueid = UUID.randomUUID().toString()) { super(script, '0.1') this.offsetpath = offsetpath + this.uniqueid = uniqueid this.meta = meta } void deserialiseJson(rawmeta) { offsetpath = rawmeta['offsetpath'] + uniqueid = rawmata['uniqueid'] ?: uniqueid meta = new MetaInfo(script) meta.deserialiseJson(rawmeta['meta']) } @@ -634,34 +639,47 @@ class MetaInfo extends GISJsonSerialised { def data = [ 'format' : format, 'offsetpath' : offsetpath, + 'uniqueid' : uniqueid, 'meta' : meta.serialisationdata(), ] return data } + + String getuniqueid() { + return uniqueid; + } } class RelatedMetaInfo_v0_2 extends RelatedMetaInfo { private String importpath private String offsetpath + private String uniqueid - RelatedMetaInfo_v0_2(script, importpath = '', offsetpath = '') { + RelatedMetaInfo_v0_2(script, String importpath = '', String offsetpath = '', String uniqueid = UUID.randomUUID().toString()) { super(script, '0.2') this.importpath = importpath this.offsetpath = offsetpath + this.uniqueid = uniqueid } void deserialiseJson(rawmeta) { //format = rawmeta['format'] offsetpath = rawmeta['offsetpath'] + uniqueid = rawmata['uniqueid'] } LinkedHashMap serialisationdata() { def data = [ 'format' : format, 'offsetpath' : offsetpath, + 'uniqueid' : uniqueid ] return data } + + String getuniqueid() { + return uniqueid; + } } private ProductInfo productinfo @@ -831,7 +849,7 @@ class MetaInfo extends GISJsonSerialised { script.echo("Deserialising meta at file: ${importedmetafile} (destpath: ${destpath})") mi.deserialiseJson(importedmetafile) - RelatedMetaInfo rmi = new RelatedMetaInfo_v0_2(script, importedmetafile, adjustedpath) + RelatedMetaInfo rmi = new RelatedMetaInfo_v0_2(script, importedmetafile, adjustedpath, mi.productinfo.uniqueid) if (appendtoparentmeta) { associatedmeta.add(rmi) } @@ -956,6 +974,13 @@ class MetaInfo extends GISJsonSerialised { String show() { return "Iteration:\nLevel: ${level}\nGathered path: ${gatheredpath}\nGathered meta path: ${gatheredmetapath}\nLimited depth: ${limiteddepth}\nMax depth: ${maxdepth}" } + + void add(CollectedMeta item) { + metacollection.add(item) + metamap.put(item.metainfo.productinfo.uniqueid, item) + } + + CollectedMeta } def openchildmeta(IterationInfo ii, RelatedMetaInfo relatedmetainfo) { @@ -965,7 +990,11 @@ class MetaInfo extends GISJsonSerialised { def String nextgatheredmetapath = (ii.gatheredmetapath == '' ? "${relatedmetainfo.offsetpath}/${METAFOLDERNAME}" : "${ii.gatheredmetapath}/${relatedmetainfo.offsetpath}") def importedmetafile = "${nextgatheredmetapath}/${METAFILENAME}" def boolean imported - if (script.fileExists(importedmetafile)) { + // If this has already been read in from a file + if (relatedmetainfo.uniqueid() in ii.metamap) { + mi = metamap[relatedmetainfo.uniqueid()].metainfo + imported = true + } else if (script.fileExists(importedmetafile)) { mi.deserialiseJson(importedmetafile) imported = true } else { @@ -985,7 +1014,7 @@ class MetaInfo extends GISJsonSerialised { def walkrelated_v0_1(IterationInfo ii) { script.echo("Walk related v0.1: ${ii.show()}") if (!ii.limiteddepth || ii.maxdepth > 0) { - ii.metacollection.add(new CollectedMeta(this, ii.gatheredpath, ii.gatheredmetapath)) + ii.add(new CollectedMeta(this, ii.gatheredpath, ii.gatheredmetapath)) ii.comment += "${ii.level} ".padRight(ii.level * 4) + globalreleasetag() + '\n' for (relatedmetainfo in associatedmeta) { if (!relatedmetainfo.format || relatedmetainfo.format == '0.1') { @@ -1015,7 +1044,7 @@ class MetaInfo extends GISJsonSerialised { def walkrelated(IterationInfo ii) { script.echo("Walk related: ${ii.show()}") if (!ii.limiteddepth || ii.maxdepth > 0) { - ii.metacollection.add(new CollectedMeta(this, ii.gatheredpath, ii.gatheredmetapath)) + ii.add(new CollectedMeta(this, ii.gatheredpath, ii.gatheredmetapath)) ii.comment += "${ii.level} ".padRight(ii.level * 4) + globalreleasetag() + '\n' for (relatedmetainfo in associatedmeta) { script.echo("Related meta info: ${relatedmetainfo.offsetpath} format: ${relatedmetainfo.format}") From a2ebb9623443225c1ef60ee2060e0a966925de05 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 21 Dec 2021 18:22:45 +0000 Subject: [PATCH 138/182] Optimise reading in of meta from files --- meta/folder.groovy | 2 -- 1 file changed, 2 deletions(-) diff --git a/meta/folder.groovy b/meta/folder.groovy index 5861293..4dc8337 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -979,8 +979,6 @@ class MetaInfo extends GISJsonSerialised { metacollection.add(item) metamap.put(item.metainfo.productinfo.uniqueid, item) } - - CollectedMeta } def openchildmeta(IterationInfo ii, RelatedMetaInfo relatedmetainfo) { From cfa543970d6062177e2593db4e5dcf08dee0b86f Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 21 Dec 2021 18:32:13 +0000 Subject: [PATCH 139/182] Optimise reading in of meta from files --- meta/folder.groovy | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/meta/folder.groovy b/meta/folder.groovy index 4dc8337..1816835 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -597,13 +597,7 @@ class MetaInfo extends GISJsonSerialised { private static String METAARTIFACTS = "${METAFOLDERNAME}/**" private static String format = '0.2' - interface IRelatedMetaInfo { - abstract void deserialiseJson(rawmeta) - abstract LinkedHashMap serialisationdata() - abstract String getuniqueid() - } - - abstract class RelatedMetaInfo extends GISJsonSerialised implements IRelatedMetaInfo { + abstract class RelatedMetaInfo extends GISJsonSerialised { String format RelatedMetaInfo(script, format) { @@ -646,7 +640,7 @@ class MetaInfo extends GISJsonSerialised { } String getuniqueid() { - return uniqueid; + return uniqueid } } @@ -678,7 +672,7 @@ class MetaInfo extends GISJsonSerialised { } String getuniqueid() { - return uniqueid; + return uniqueid } } From d7965ea280c368a8cdb4de816f97ce2cb03c84d0 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 21 Dec 2021 18:39:13 +0000 Subject: [PATCH 140/182] Optimise reading in of meta from files --- meta/folder.groovy | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/meta/folder.groovy b/meta/folder.groovy index 1816835..e28d28c 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -607,7 +607,7 @@ class MetaInfo extends GISJsonSerialised { abstract void deserialiseJson(rawmeta) abstract LinkedHashMap serialisationdata() - abstract String getuniqueid() + abstract String getrelatedid() } class RelatedMetaInfo_v0_1 extends RelatedMetaInfo { @@ -639,7 +639,7 @@ class MetaInfo extends GISJsonSerialised { return data } - String getuniqueid() { + String getrelatedid() { return uniqueid } } @@ -671,7 +671,7 @@ class MetaInfo extends GISJsonSerialised { return data } - String getuniqueid() { + String getrelatedid() { return uniqueid } } @@ -983,8 +983,8 @@ class MetaInfo extends GISJsonSerialised { def importedmetafile = "${nextgatheredmetapath}/${METAFILENAME}" def boolean imported // If this has already been read in from a file - if (relatedmetainfo.uniqueid() in ii.metamap) { - mi = metamap[relatedmetainfo.uniqueid()].metainfo + if (relatedmetainfo.getrelatedid() in ii.metamap) { + mi = metamap[relatedmetainfo.getrelatedid()].metainfo imported = true } else if (script.fileExists(importedmetafile)) { mi.deserialiseJson(importedmetafile) From 88ca474a706f0444c9751b1e947b0e9385fa8418 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Wed, 22 Dec 2021 09:44:35 +0000 Subject: [PATCH 141/182] Optimise reading in of meta from files --- meta/folder.groovy | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meta/folder.groovy b/meta/folder.groovy index e28d28c..112f3d6 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -624,7 +624,7 @@ class MetaInfo extends GISJsonSerialised { void deserialiseJson(rawmeta) { offsetpath = rawmeta['offsetpath'] - uniqueid = rawmata['uniqueid'] ?: uniqueid + uniqueid = rawmeta['uniqueid'] ?: uniqueid meta = new MetaInfo(script) meta.deserialiseJson(rawmeta['meta']) } @@ -659,7 +659,7 @@ class MetaInfo extends GISJsonSerialised { void deserialiseJson(rawmeta) { //format = rawmeta['format'] offsetpath = rawmeta['offsetpath'] - uniqueid = rawmata['uniqueid'] + uniqueid = rawmeta['uniqueid'] } LinkedHashMap serialisationdata() { From 984d996d88828f0db5ae9fbe032b13e7af3c03d9 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Wed, 22 Dec 2021 11:57:56 +0000 Subject: [PATCH 142/182] Optimise reading in of meta from files --- meta/folder.groovy | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/meta/folder.groovy b/meta/folder.groovy index 112f3d6..faface8 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -984,7 +984,8 @@ class MetaInfo extends GISJsonSerialised { def boolean imported // If this has already been read in from a file if (relatedmetainfo.getrelatedid() in ii.metamap) { - mi = metamap[relatedmetainfo.getrelatedid()].metainfo + script.echo("Could not deserialise meta at file: ${importedmetafile} - Does not exist") + mi = ii.metamap[relatedmetainfo.getrelatedid()].metainfo imported = true } else if (script.fileExists(importedmetafile)) { mi.deserialiseJson(importedmetafile) From 85dd6534c6c4db549aaa3cf1ce86377e476b79ad Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Wed, 22 Dec 2021 12:20:28 +0000 Subject: [PATCH 143/182] Optimise reading in of meta from files --- meta/folder.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta/folder.groovy b/meta/folder.groovy index faface8..8b3c22d 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -984,7 +984,7 @@ class MetaInfo extends GISJsonSerialised { def boolean imported // If this has already been read in from a file if (relatedmetainfo.getrelatedid() in ii.metamap) { - script.echo("Could not deserialise meta at file: ${importedmetafile} - Does not exist") + script.echo("Already read in meta associated with uniqueid: ${relatedmetainfo.getrelatedid()} - Using it") mi = ii.metamap[relatedmetainfo.getrelatedid()].metainfo imported = true } else if (script.fileExists(importedmetafile)) { From 466385016223c72f33a0f645291d44317c7186aa Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Thu, 23 Dec 2021 14:16:27 +0000 Subject: [PATCH 144/182] Correct walking through v0.1 associatedmeta --- meta/folder.groovy | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/meta/folder.groovy b/meta/folder.groovy index 8b3c22d..d63b84a 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -1059,12 +1059,14 @@ class MetaInfo extends GISJsonSerialised { } } else if (!relatedmetainfo.format || relatedmetainfo.format == '0.1') { def MetaInfo othermeta = relatedmetainfo.meta + def String nextgatheredpath = (ii.gatheredpath == '' ? relatedmetainfo.offsetpath : "${ii.gatheredpath}/${relatedmetainfo.offsetpath}") + def String nextgatheredmetapath = (ii.gatheredmetapath == '' ? relatedmetainfo.offsetpath : "${ii.gatheredmetapath}/${relatedmetainfo.offsetpath}") def nextii = new IterationInfo(ii.metacollection, ii.metamap, ii.comment, ii.level + 1, - ii.gatheredpath, - ii.gatheredmetapath, + nextgatheredpath, + nextgatheredmetapath, ii.limiteddepth, ii.maxdepth - 1) def results = othermeta.walkrelated_v0_1(nextii) From e8751753d50104874d49cbbdd64e26d785e1a017 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Thu, 23 Dec 2021 18:30:23 +0000 Subject: [PATCH 145/182] Correct diffing to use new meta hierarchy --- differences/dometahierarchy.groovy | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/differences/dometahierarchy.groovy b/differences/dometahierarchy.groovy index 40394d5..3b25798 100644 --- a/differences/dometahierarchy.groovy +++ b/differences/dometahierarchy.groovy @@ -803,8 +803,8 @@ def comparehierarchy(meta, String earlymetafolder, String latermetafolder, Strin def earlymeta = meta.importrelated(true, earlymetafolder) def latermeta = meta.importrelated(true, latermetafolder) - def earlymetaitems = earlymeta.releasewalkerunique(md) - def latermetaitems = latermeta.releasewalkerunique(md) + def earlymetaitems = earlymeta.releasewalkerunique(md, '', earlymetafolder) + def latermetaitems = latermeta.releasewalkerunique(md, '', latermetafolder) echo "Early items:" showmetaitems(earlymetaitems) From bdbc579b38d51edbdeeb39a7071d85c9b6fa053a Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Fri, 24 Dec 2021 09:13:57 +0000 Subject: [PATCH 146/182] Pass meta path to publisher walker --- publish/do.groovy | 8 ++++---- publish/promptingpublish.groovy | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/publish/do.groovy b/publish/do.groovy index 9f5bd21..ea090f0 100644 --- a/publish/do.groovy +++ b/publish/do.groovy @@ -140,14 +140,14 @@ def convertitemstopublish(String itemstopublishstring) { // Publish selected items from a release to the customer folder on the ftp site // itemstopublishstring is a comma-seperated set of strings in this format ## -def publishhierarchy(hostedftpsiteinfo, releasemeta, String itemstopublishstring, String customer, String softwarerelease, String maxdepth) { +def publishhierarchy(hostedftpsiteinfo, releasemeta, String releasemetapath, String itemstopublishstring, String customer, String softwarerelease, String maxdepth) { int md = maxdepth.toInteger() resetfolders() preconditions() def productline = releasemeta.productinfo.productname // Walk the meta information to a max depth, looking for artifacts to publish - def componentReleaseInfoVersionUnique = releasemeta.releasewalkerversionunique(md) + def componentReleaseInfoVersionUnique = releasemeta.releasewalkerversionunique(md, '', releasemetapath) echo "Version unique components:" def String versionuniquecomponent = "" @@ -167,8 +167,8 @@ def publishhierarchy(hostedftpsiteinfo, releasemeta, String itemstopublishstring return [summarystring, markunstable, unstablereason] } -def publishhierarchy(hostedftpsiteinfo, releasemeta, String customer, String softwarerelease, String maxdepth) { - return publishhierarchy(hostedftpsiteinfo, releasemeta, "", customer, softwarerelease, maxdepth) +def publishhierarchy(hostedftpsiteinfo, releasemeta, String releasemetapath, String customer, String softwarerelease, String maxdepth) { + return publishhierarchy(hostedftpsiteinfo, releasemeta, releasemetapath, '', customer, softwarerelease, maxdepth) } return this; diff --git a/publish/promptingpublish.groovy b/publish/promptingpublish.groovy index 58c72eb..4cc0e24 100644 --- a/publish/promptingpublish.groovy +++ b/publish/promptingpublish.groovy @@ -135,7 +135,7 @@ pipeline { script { def publisher = load("${autobuilder.commonscripts()}/publish/do.groovy") def hostedftpsiteinfo = hostedftb.getHostedFTPSiteInfo() - (summarystring, markunstable, unstablereason) = publisher.publishhierarchy(hostedftpsiteinfo, releasemeta, selecteditems, customer, release, MAX_META_DEPTH) + (summarystring, markunstable, unstablereason) = publisher.publishhierarchy(hostedftpsiteinfo, releasemeta, SOURCEDIR, selecteditems, customer, release, MAX_META_DEPTH) if (markunstable) { env.unstablereason = unstablereason currentBuild.result = 'UNSTABLE' From c8a66b7eb6b6fbac24daf65e00573a0228780afa Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Fri, 24 Dec 2021 10:58:06 +0000 Subject: [PATCH 147/182] Exclude erroneous sub-component from release --- release/do.groovy | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/release/do.groovy b/release/do.groovy index c61f1dd..05f9d53 100644 --- a/release/do.groovy +++ b/release/do.groovy @@ -441,8 +441,10 @@ def releasehierarchy(String buildfolder, String metafolder, buildmeta, String ma // For each component for (key in componentReleaseInfo.keySet()) { def buildinfo = componentReleaseInfo[key] - if (toplevelid != key) { - releasecomponent(buildmeta, buildinfo, otherreleasetags, dryrunpush) + if (buildinfo.metainfo.componentidentifier != '___') { + if (toplevelid != key) { + releasecomponent(buildmeta, buildinfo, otherreleasetags, dryrunpush) + } } } // Do the top level last From fb35654c9ac71ec738fbd76c598fceda8289f553 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Fri, 24 Dec 2021 11:02:05 +0000 Subject: [PATCH 148/182] Exclude erroneous sub-component from release --- release/do.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release/do.groovy b/release/do.groovy index 05f9d53..09249ad 100644 --- a/release/do.groovy +++ b/release/do.groovy @@ -441,7 +441,7 @@ def releasehierarchy(String buildfolder, String metafolder, buildmeta, String ma // For each component for (key in componentReleaseInfo.keySet()) { def buildinfo = componentReleaseInfo[key] - if (buildinfo.metainfo.componentidentifier != '___') { + if (buildinfo.metainfo.componentidentifier() != '___') { if (toplevelid != key) { releasecomponent(buildmeta, buildinfo, otherreleasetags, dryrunpush) } From 8297893901f91026893e94e802ff663dd570e6cb Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Mon, 27 Dec 2021 21:15:08 +0000 Subject: [PATCH 149/182] Correct publish list --- publish/promptingpublish.groovy | 1 + publish/publishitems.groovy | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/publish/promptingpublish.groovy b/publish/promptingpublish.groovy index 4cc0e24..ce6a805 100644 --- a/publish/promptingpublish.groovy +++ b/publish/promptingpublish.groovy @@ -114,6 +114,7 @@ pipeline { 'Select software items', 'Software items', releasemeta, + SOURCEDIR, ITEMSDEFAULTLIST, MAX_META_DEPTH, '20', diff --git a/publish/publishitems.groovy b/publish/publishitems.groovy index 06e5fba..9f6c368 100644 --- a/publish/publishitems.groovy +++ b/publish/publishitems.groovy @@ -18,6 +18,7 @@ class PublishableItemsSelection { String name, String description, releasemeta, + String releasemetapath, String preselectedext, String metalevelsstringext, String visibleItemCountExt, @@ -25,7 +26,7 @@ class PublishableItemsSelection { outputSelectionfromPreselect(preselectedmenuitems, preselectedext) def Integer metalevelsext = metalevelsstringext.toInteger() def Integer visibleItemCount = visibleItemCountExt.toInteger() - def metaitems = releasemeta.releasewalkerunique(metalevelsext) + def metaitems = releasemeta.releasewalkerunique(metalevelsext, '', releasemetapath) for (key in metaitems.keySet()) { def releaseinfo = metaitems[key] outputDescription(menuitemdescriptions, releaseinfo) @@ -113,13 +114,14 @@ PublishableItemsSelection createItemSelector( String name, String description, releasemeta, + String releasemetapath, String preselectedext, String metalevelsstringext, String visibleItemCountExt = '20', String type = 'PT_CHECKBOX') { // Could also be "PT_MULTI_SELECT" PublishableItemsSelection pis = new PublishableItemsSelection(this) - pis.init(name, description, releasemeta, preselectedext, metalevelsstringext, visibleItemCountExt, type) + pis.init(name, description, releasemeta, releasemetapath, preselectedext, metalevelsstringext, visibleItemCountExt, type) return pis } From 600d4584db6070fe88587a8505fce172f58c307d Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Mon, 27 Dec 2021 22:59:14 +0000 Subject: [PATCH 150/182] Remove timeout warning --- versioncontrol/git.groovy | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/versioncontrol/git.groovy b/versioncontrol/git.groovy index 288d5db..a22054b 100644 --- a/versioncontrol/git.groovy +++ b/versioncontrol/git.groovy @@ -195,8 +195,8 @@ def docheckout(String gitURL, String revision, int cloneDepth, String reporootpa [name: revision] ], extensions: [ - [$class: 'GitLFSPull',timeout: 25], - [$class: 'CleanBeforeCheckout',timeout: 20], + [$class: 'GitLFSPull'], + [$class: 'CleanBeforeCheckout'], [$class: 'CloneOption', depth: cloneDepth, noTags: false, reference: reporootpath, shallow: shallowClone, timeout: 120], [$class: 'CheckoutOption', timeout: 120], [$class: 'RelativeTargetDirectory', relativeTargetDir: targetDir], From 79c1928d730cd4afb9e476f538ea0f81c4eeae5e Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Mon, 3 Jan 2022 09:47:40 +0000 Subject: [PATCH 151/182] Remove debug from console --- meta/folder.groovy | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/meta/folder.groovy b/meta/folder.groovy index d63b84a..b9e898c 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -984,7 +984,7 @@ class MetaInfo extends GISJsonSerialised { def boolean imported // If this has already been read in from a file if (relatedmetainfo.getrelatedid() in ii.metamap) { - script.echo("Already read in meta associated with uniqueid: ${relatedmetainfo.getrelatedid()} - Using it") + //script.echo("Already read in meta associated with uniqueid: ${relatedmetainfo.getrelatedid()} - Using it") mi = ii.metamap[relatedmetainfo.getrelatedid()].metainfo imported = true } else if (script.fileExists(importedmetafile)) { @@ -1005,7 +1005,7 @@ class MetaInfo extends GISJsonSerialised { } def walkrelated_v0_1(IterationInfo ii) { - script.echo("Walk related v0.1: ${ii.show()}") + //script.echo("Walk related v0.1: ${ii.show()}") if (!ii.limiteddepth || ii.maxdepth > 0) { ii.add(new CollectedMeta(this, ii.gatheredpath, ii.gatheredmetapath)) ii.comment += "${ii.level} ".padRight(ii.level * 4) + globalreleasetag() + '\n' @@ -1035,12 +1035,12 @@ class MetaInfo extends GISJsonSerialised { } def walkrelated(IterationInfo ii) { - script.echo("Walk related: ${ii.show()}") + //script.echo("Walk related: ${ii.show()}") if (!ii.limiteddepth || ii.maxdepth > 0) { ii.add(new CollectedMeta(this, ii.gatheredpath, ii.gatheredmetapath)) ii.comment += "${ii.level} ".padRight(ii.level * 4) + globalreleasetag() + '\n' for (relatedmetainfo in associatedmeta) { - script.echo("Related meta info: ${relatedmetainfo.offsetpath} format: ${relatedmetainfo.format}") + //script.echo("Related meta info: ${relatedmetainfo.offsetpath} format: ${relatedmetainfo.format}") if (relatedmetainfo.format == '0.2') { def childmetainfo = openchildmeta(ii, relatedmetainfo) if (childmetainfo.imported) { From bf60873908fd4b1c2e609ab55e7bac64b6e78b99 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Mon, 3 Jan 2022 10:00:09 +0000 Subject: [PATCH 152/182] Show which component is being released --- release/do.groovy | 1 + 1 file changed, 1 insertion(+) diff --git a/release/do.groovy b/release/do.groovy index 09249ad..6dcdd78 100644 --- a/release/do.groovy +++ b/release/do.groovy @@ -441,6 +441,7 @@ def releasehierarchy(String buildfolder, String metafolder, buildmeta, String ma // For each component for (key in componentReleaseInfo.keySet()) { def buildinfo = componentReleaseInfo[key] + echo "Releasing component: ${buildinfo.metainfo.componentidentifier()}" if (buildinfo.metainfo.componentidentifier() != '___') { if (toplevelid != key) { releasecomponent(buildmeta, buildinfo, otherreleasetags, dryrunpush) From 6f0a4482be9cd4dec08d07b9e58dab1611fb5123 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Wed, 5 Jan 2022 07:55:36 +0000 Subject: [PATCH 153/182] Handle old components that have blank product and component names --- release/do.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release/do.groovy b/release/do.groovy index 6dcdd78..4dcb091 100644 --- a/release/do.groovy +++ b/release/do.groovy @@ -442,7 +442,7 @@ def releasehierarchy(String buildfolder, String metafolder, buildmeta, String ma for (key in componentReleaseInfo.keySet()) { def buildinfo = componentReleaseInfo[key] echo "Releasing component: ${buildinfo.metainfo.componentidentifier()}" - if (buildinfo.metainfo.componentidentifier() != '___') { + if (buildinfo.metainfo.componentidentifier() != '___' && buildinfo.metainfo.componentidentifier() != '_') { if (toplevelid != key) { releasecomponent(buildmeta, buildinfo, otherreleasetags, dryrunpush) } From 9d04525431e7a45a2be8dc02c005b737b2f0bcf0 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 11 Jan 2022 14:40:15 +0000 Subject: [PATCH 154/182] Correct hierarchical import of artifacts from release repositories --- import/importer.groovy | 8 ++++---- meta/folder.groovy | 10 ++++++---- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/import/importer.groovy b/import/importer.groovy index 8bb565a..2c40215 100644 --- a/import/importer.groovy +++ b/import/importer.groovy @@ -200,11 +200,11 @@ def hierarchyartifactimportfromrepo(meta, importoptions, String destpath) { def importedmeta = meta.importrelated(importoptions.m_appendtoparentmeta, destpath, rooturl, rootrevision, gh.getGitInfo(destpath)) - relatedimportinfo = importedmeta.getassociated() + def collectedmetalist = importedmeta.getassociated(destpath) echo "Cloning associated repos" - for(relatedmetainfo in relatedimportinfo) { - def relatedmeta = relatedmetainfo.meta - def relatedoffsetpath = relatedmetainfo.offsetpath + for(def collectedmeta in collectedmetalist) { + def relatedmeta = collectedmeta.metainfo + def relatedoffsetpath = collectedmeta.accumulatedpath def cloneurl = relatedmeta.releaseinfo.releaserepoURL def clonerevision = "refs/tags/${relatedmeta.releasetag()}" def clonepath = "${destpath}/${relatedoffsetpath}" diff --git a/meta/folder.groovy b/meta/folder.groovy index b9e898c..1fdd3ff 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -701,10 +701,6 @@ class MetaInfo extends GISJsonSerialised { associatedmeta = new ArrayList() } - List getassociated() { - return associatedmeta - } - void markreleased() { script.echo("Marking product: ${productinfo.productname} component: ${productinfo.subcomponentname} as released") releaseinfo.markreleased() @@ -1079,6 +1075,7 @@ class MetaInfo extends GISJsonSerialised { return [ 'metacollection' : ii.metacollection, 'metamap' : ii.metamap, 'comment': ii.comment ] } + // Walks all layers of associated data only def allrelatedmeta(String metapath = '') { def ArrayList metacollection = new ArrayList() def Map metamap = new LinkedHashMap() @@ -1092,6 +1089,11 @@ class MetaInfo extends GISJsonSerialised { return results.metacollection } + // Walks 1 layer of associated data only + def getassociated(String metapath) { + return releasewalker(1, '', metapath) + } + Map putwithshortestoffsetpath(Map releasemetacollection, String uniquestring, CollectedMeta metaitem) { if (releasemetacollection.containsKey(uniquestring)) { def existingentry = releasemetacollection[uniquestring] From 51224e052613daa518de977758d630a026b8bf73 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 11 Jan 2022 15:08:15 +0000 Subject: [PATCH 155/182] Correct hierarchical import of artifacts from release repositories --- import/importer.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/import/importer.groovy b/import/importer.groovy index 2c40215..773c7a7 100644 --- a/import/importer.groovy +++ b/import/importer.groovy @@ -214,7 +214,7 @@ def hierarchyartifactimportfromrepo(meta, importoptions, String destpath) { gh.stripgithistory(clonepath) - def metafilepath = "${clonepath}/${relatedmeta.metafilepath()}" + def metafilepath = "${clonepath}${relatedmeta.metafilepath()}" echo "Marking related meta as released and rewriting meta file: ${metafilepath}" rewritemetafileasreleased(relatedmeta, metafilepath) } From 8be38b88522cc3a8a119d6ae98e38ae13c6b9025 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 11 Jan 2022 15:14:48 +0000 Subject: [PATCH 156/182] Correct hierarchical import of artifacts from release repositories --- import/importer.groovy | 6 ++++-- meta/folder.groovy | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/import/importer.groovy b/import/importer.groovy index 773c7a7..621e5f2 100644 --- a/import/importer.groovy +++ b/import/importer.groovy @@ -199,9 +199,11 @@ def hierarchyartifactimportfromrepo(meta, importoptions, String destpath) { gh.gitCheckoutAlt(rooturl, rootrevision, destpath, "", 1, true, sparseitemlist) def importedmeta = meta.importrelated(importoptions.m_appendtoparentmeta, destpath, rooturl, rootrevision, gh.getGitInfo(destpath)) - + + echo "Getting associated metadata from path ${destpath}" def collectedmetalist = importedmeta.getassociated(destpath) - echo "Cloning associated repos" + + echo "Cloning associated repos inside ${destpath}" for(def collectedmeta in collectedmetalist) { def relatedmeta = collectedmeta.metainfo def relatedoffsetpath = collectedmeta.accumulatedpath diff --git a/meta/folder.groovy b/meta/folder.groovy index 1fdd3ff..12bc2cb 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -1090,8 +1090,8 @@ class MetaInfo extends GISJsonSerialised { } // Walks 1 layer of associated data only - def getassociated(String metapath) { - return releasewalker(1, '', metapath) + def getassociated(String rootpath) { + return releasewalker(1, rootpath, "${rootpath}/${METAFOLDERNAME}") } Map putwithshortestoffsetpath(Map releasemetacollection, String uniquestring, CollectedMeta metaitem) { From 5c3c949e374c1b59a53e75bb0469910b9efd195d Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 11 Jan 2022 15:20:27 +0000 Subject: [PATCH 157/182] Correct hierarchical import of artifacts from release repositories --- import/importer.groovy | 4 ++-- meta/folder.groovy | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/import/importer.groovy b/import/importer.groovy index 621e5f2..208e66b 100644 --- a/import/importer.groovy +++ b/import/importer.groovy @@ -200,10 +200,10 @@ def hierarchyartifactimportfromrepo(meta, importoptions, String destpath) { def importedmeta = meta.importrelated(importoptions.m_appendtoparentmeta, destpath, rooturl, rootrevision, gh.getGitInfo(destpath)) - echo "Getting associated metadata from path ${destpath}" + echo "Getting associated metadata from path: ${destpath}" def collectedmetalist = importedmeta.getassociated(destpath) - echo "Cloning associated repos inside ${destpath}" + echo "Cloning associated repos inside path: ${destpath}" for(def collectedmeta in collectedmetalist) { def relatedmeta = collectedmeta.metainfo def relatedoffsetpath = collectedmeta.accumulatedpath diff --git a/meta/folder.groovy b/meta/folder.groovy index 12bc2cb..de613f5 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -1091,7 +1091,7 @@ class MetaInfo extends GISJsonSerialised { // Walks 1 layer of associated data only def getassociated(String rootpath) { - return releasewalker(1, rootpath, "${rootpath}/${METAFOLDERNAME}") + return releasewalker(1, '', "${rootpath}/${METAFOLDERNAME}") } Map putwithshortestoffsetpath(Map releasemetacollection, String uniquestring, CollectedMeta metaitem) { From eb72549852e5f60ad5b1f5782406ef7d28d4e95f Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 11 Jan 2022 15:45:17 +0000 Subject: [PATCH 158/182] Correct hierarchical import of artifacts from release repositories --- meta/folder.groovy | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/meta/folder.groovy b/meta/folder.groovy index de613f5..f08ecae 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -608,6 +608,7 @@ class MetaInfo extends GISJsonSerialised { abstract void deserialiseJson(rawmeta) abstract LinkedHashMap serialisationdata() abstract String getrelatedid() + abstract void markreleased() } class RelatedMetaInfo_v0_1 extends RelatedMetaInfo { @@ -642,6 +643,10 @@ class MetaInfo extends GISJsonSerialised { String getrelatedid() { return uniqueid } + + void markreleased() { + meta.releaseinfo.markreleased() + } } class RelatedMetaInfo_v0_2 extends RelatedMetaInfo { @@ -674,6 +679,10 @@ class MetaInfo extends GISJsonSerialised { String getrelatedid() { return uniqueid } + + void markreleased() { + // Do nothing + } } private ProductInfo productinfo @@ -705,7 +714,7 @@ class MetaInfo extends GISJsonSerialised { script.echo("Marking product: ${productinfo.productname} component: ${productinfo.subcomponentname} as released") releaseinfo.markreleased() for (associated in associatedmeta) { - associated.meta.releaseinfo.markreleased() + associated.markreleased() } } From b365f5b41825d26767635818b6ef2ed8c2583f62 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 11 Jan 2022 15:58:45 +0000 Subject: [PATCH 159/182] Correct hierarchical import of artifacts from release repositories --- meta/folder.groovy | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/meta/folder.groovy b/meta/folder.groovy index f08ecae..9558ce9 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -1094,7 +1094,9 @@ class MetaInfo extends GISJsonSerialised { ArrayList releasewalker(int maxdepth, String startpath = '', String startmetapath = '') { def ArrayList metacollection = new ArrayList() def Map metamap = new LinkedHashMap() - def results = walkrelated(new IterationInfo(metacollection, metamap, 'meta', 0, startpath, startmetapath, true, maxdepth)) + def IterationInfo ii = new IterationInfo(metacollection, metamap, 'meta', 0, startpath, startmetapath, true, maxdepth) + script.echo("Release walker interation info at start:\n${ii.show()}") + def results = walkrelated(ii) return results.metacollection } From 00afcebd3df0b2489e424488ec7dd742770e4b1d Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 11 Jan 2022 16:23:57 +0000 Subject: [PATCH 160/182] Correct hierarchical import of artifacts from release repositories --- import/importer.groovy | 3 +++ meta/folder.groovy | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/import/importer.groovy b/import/importer.groovy index 208e66b..0e870af 100644 --- a/import/importer.groovy +++ b/import/importer.groovy @@ -202,6 +202,9 @@ def hierarchyartifactimportfromrepo(meta, importoptions, String destpath) { echo "Getting associated metadata from path: ${destpath}" def collectedmetalist = importedmeta.getassociated(destpath) + for(def collectedmeta in collectedmetalist) { + echo "Collection meta item: ${collectedmeta.metainfo.componentversionuniqueidentifier()} offset path: ${collectedmeta.accumulatedpath}" + } echo "Cloning associated repos inside path: ${destpath}" for(def collectedmeta in collectedmetalist) { diff --git a/meta/folder.groovy b/meta/folder.groovy index 9558ce9..b6d9a76 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -1095,7 +1095,7 @@ class MetaInfo extends GISJsonSerialised { def ArrayList metacollection = new ArrayList() def Map metamap = new LinkedHashMap() def IterationInfo ii = new IterationInfo(metacollection, metamap, 'meta', 0, startpath, startmetapath, true, maxdepth) - script.echo("Release walker interation info at start:\n${ii.show()}") + script.echo("Release walker iteration info at start:\n${ii.show()}") def results = walkrelated(ii) return results.metacollection } From 1a0dcf9ac2f7b6fb8f2b2bdca9746e2bb45fc9aa Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 11 Jan 2022 16:34:23 +0000 Subject: [PATCH 161/182] Correct hierarchical import of artifacts from release repositories --- meta/folder.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta/folder.groovy b/meta/folder.groovy index b6d9a76..6715145 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -1102,7 +1102,7 @@ class MetaInfo extends GISJsonSerialised { // Walks 1 layer of associated data only def getassociated(String rootpath) { - return releasewalker(1, '', "${rootpath}/${METAFOLDERNAME}") + return releasewalker(2, '', "${rootpath}/${METAFOLDERNAME}") // Max depth 2 (including itself) } Map putwithshortestoffsetpath(Map releasemetacollection, String uniquestring, CollectedMeta metaitem) { From aaa7b8ac086bbba6aa5e483f890214f029e59ebf Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 11 Jan 2022 17:39:57 +0000 Subject: [PATCH 162/182] Correct hierarchical import of artifacts from release repositories --- import/importer.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/import/importer.groovy b/import/importer.groovy index 0e870af..22dbc9e 100644 --- a/import/importer.groovy +++ b/import/importer.groovy @@ -56,7 +56,7 @@ class ImportOptions { m_sourceselect = sourceselect break default: - error("Unknown type of artifact source select: ${m_sourceselect}") + m_script.error("Unknown type of artifact source select: ${m_sourceselect}") } } From 0c87c2bccb2ebbeb78df00e015b73ce4dad20aad Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 11 Jan 2022 17:42:14 +0000 Subject: [PATCH 163/182] Correct hierarchical import of artifacts from release repositories --- import/importer.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/import/importer.groovy b/import/importer.groovy index 22dbc9e..6ec0841 100644 --- a/import/importer.groovy +++ b/import/importer.groovy @@ -56,7 +56,7 @@ class ImportOptions { m_sourceselect = sourceselect break default: - m_script.error("Unknown type of artifact source select: ${m_sourceselect}") + m_script.error("Unknown type of artifact source select: ${sourceselect}") } } From 2c26b221f12ad963c322612f2935afeb2705c68c Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 11 Jan 2022 18:09:03 +0000 Subject: [PATCH 164/182] Correct hierarchical import of artifacts from release repositories --- import/importer.groovy | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/import/importer.groovy b/import/importer.groovy index 6ec0841..bb0d32e 100644 --- a/import/importer.groovy +++ b/import/importer.groovy @@ -151,7 +151,7 @@ def conditionalClean(ImportOptions importoptions, String destpath) { } } -def artifactimportfrombuildjob(meta, importoptions, String destpath) { +def artifactimportfrombuildjob(meta, ImportOptions importoptions, String destpath) { if (importoptions.m_sourceselect != 'Jenkins job artifact') { error("Import options settings have not been set for: Jenkins job artifact") return @@ -183,7 +183,7 @@ def rewritemetafileasreleased(meta, String filepath) { meta.saveJsonSerialised(filepath) } -def hierarchyartifactimportfromrepo(meta, importoptions, String destpath) { +def hierarchyartifactimportfromrepo(meta, ImportOptions importoptions, String destpath) { if (importoptions.m_sourceselect != 'Release repository') { error("Import options settings have not been set for: Release repository") return @@ -234,7 +234,7 @@ def hierarchyartifactimportfromrepo(meta, importoptions, String destpath) { return importedmeta } -def artifactimportfromrepo(meta, importoptions, String destpath) { +def artifactimportfromrepo(meta, ImportOptions importoptions, String destpath) { if (importoptions.m_sourceselect != 'Release repository') { error("Import options settings have not been set for: Release repository") return @@ -262,7 +262,7 @@ def artifactimportfromrepo(meta, importoptions, String destpath) { return importedmeta } -def artifactimport(meta, importoptions, String destpath) { +def artifactimport(meta, ImportOptions importoptions, String destpath) { switch (importoptions.m_sourceselect) { case 'Jenkins job artifact': case 'Jenkins job artefact': @@ -347,7 +347,13 @@ def artifactimport(meta, } // Import the artifacts of a named child component found below parent meta's hierarchy -def artifactimport(meta, parentmeta, String parentmetapath, String childproduct, String childsubcomponent, importoptions, String destinationfolder) { +def artifactimport(meta, + parentmeta, + String parentmetapath, + String childproduct, + String childsubcomponent, + ImportOptions importoptions, + String destinationfolder) { // Import from parent meta def childmeta = meta.getNewMetaObject() def childmeta2 @@ -356,7 +362,7 @@ def artifactimport(meta, parentmeta, String parentmetapath, String childproduct, def findresults = parentmeta.findAssociatedMeta(parentmetapath, childproduct, childsubcomponent) if (findresults.matchfound) { childmeta = findresults.matchedmetaitem.metainfo - if (childmeta.releaseinfo.released) { + if (importoptions.m_sourceselect == 'Release repository' || childmeta.releaseinfo.released) { importoptions.releaserepo(childmeta.releaseinfo.releaserepoURL, childmeta.releasetag()) } else { importoptions.jenkinsjob(childmeta.jenkinsbuildinfo.buildjobname, childmeta.jenkinsbuildinfo.buildnumber) From f821da79d81ee32c13f98d60210f76e09c4bb772 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Thu, 13 Jan 2022 12:38:49 +0000 Subject: [PATCH 165/182] CORE-594 - Debug installer creation --- import/importer.groovy | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/import/importer.groovy b/import/importer.groovy index bb0d32e..8df88e1 100644 --- a/import/importer.groovy +++ b/import/importer.groovy @@ -45,6 +45,10 @@ class ImportOptions { m_appendtoparentmeta = appendtoparentmeta } + void show() { + script.echo(this.toString()) + } + void setsourceselect(String sourceselect) { sourceselect = sourceselect.trim() switch (sourceselect) { @@ -263,6 +267,7 @@ def artifactimportfromrepo(meta, ImportOptions importoptions, String destpath) { } def artifactimport(meta, ImportOptions importoptions, String destpath) { + importoptions.show() switch (importoptions.m_sourceselect) { case 'Jenkins job artifact': case 'Jenkins job artefact': From cfcdf5c827e9614001893376e96dc7e6f9c441a8 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Thu, 13 Jan 2022 12:40:52 +0000 Subject: [PATCH 166/182] CORE-594 - Debug installer creation --- import/importer.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/import/importer.groovy b/import/importer.groovy index 8df88e1..8bc96a3 100644 --- a/import/importer.groovy +++ b/import/importer.groovy @@ -46,7 +46,7 @@ class ImportOptions { } void show() { - script.echo(this.toString()) + m_script.echo(this.toString()) } void setsourceselect(String sourceselect) { From 5b3f7a7226ba252489459f8b74f767491f00e5ae Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Thu, 13 Jan 2022 13:03:32 +0000 Subject: [PATCH 167/182] CORE-594 - Debug installer creation --- import/importer.groovy | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/import/importer.groovy b/import/importer.groovy index 8bc96a3..2f7611e 100644 --- a/import/importer.groovy +++ b/import/importer.groovy @@ -45,8 +45,22 @@ class ImportOptions { m_appendtoparentmeta = appendtoparentmeta } - void show() { - m_script.echo(this.toString()) + String show() { + return """m_incrementversionnumber: ${m_incrementversionnumber} + m_filter: ${m_filter} + m_excludes: ${m_excludes} + m_fingerprint: ${m_fingerprint} + m_nested: ${m_nested} + m_flatten: ${m_flatten} + m_includemetainfilter: ${m_includemetainfilter} + m_clean: ${m_clean} + m_appendtoparentmeta: ${m_appendtoparentmeta} + m_sourceselect: ${m_sourceselect} + m_jobname: ${m_jobname} + m_buildnumberorselector: ${m_buildnumberorselector} + m_repo: ${m_repo} + m_revision: ${m_revision} + """ } void setsourceselect(String sourceselect) { @@ -267,7 +281,7 @@ def artifactimportfromrepo(meta, ImportOptions importoptions, String destpath) { } def artifactimport(meta, ImportOptions importoptions, String destpath) { - importoptions.show() + echo "Importing artifacts: Import options:\n${importoptions.show()}\n to: ${destpath}" switch (importoptions.m_sourceselect) { case 'Jenkins job artifact': case 'Jenkins job artefact': From a1c2d3b336a64e7bfa71e45381b74e78ea3b07f3 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Thu, 13 Jan 2022 13:35:50 +0000 Subject: [PATCH 168/182] CORE-594 - Debug installer creation --- import/importer.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/import/importer.groovy b/import/importer.groovy index 2f7611e..af40c5f 100644 --- a/import/importer.groovy +++ b/import/importer.groovy @@ -127,7 +127,7 @@ class ImportOptions { m_jobname = jobname.trim() m_buildnumberorselector = [ $class: 'ParameterizedBuildSelector', - parameterName: "${buildnumberorselector}" + parameterName: "${buildnumberorselector}" ] setsourceselect('Jenkins job artifact') } From 36ed63e11b8a994ce8fefe0b8b903f25765e5814 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Thu, 13 Jan 2022 13:39:13 +0000 Subject: [PATCH 169/182] CORE-594 - Debug installer creation --- import/importer.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/import/importer.groovy b/import/importer.groovy index af40c5f..b2dc41b 100644 --- a/import/importer.groovy +++ b/import/importer.groovy @@ -114,7 +114,7 @@ class ImportOptions { m_appendtoparentmeta = appendtoparentmeta } - void jenkinsjob(String jobname, buildnumberorselector) { + void jenkinsjob(String jobname, String buildnumberorselector) { m_jobname = jobname.trim() m_buildnumberorselector = [ $class: 'ParameterizedBuildSelector', From 945f83759dfb6817275abed13480f3ff18c51675 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Thu, 13 Jan 2022 14:16:27 +0000 Subject: [PATCH 170/182] CORE-594 - Debug installer creation --- import/importer.groovy | 10 ++++++++-- install/installhelper.groovy | 1 + 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/import/importer.groovy b/import/importer.groovy index b2dc41b..d6fb4d4 100644 --- a/import/importer.groovy +++ b/import/importer.groovy @@ -20,6 +20,8 @@ class ImportOptions { String m_repo String m_revision + + boolean m_showdetails ImportOptions(script, String sourceselect = 'Jenkins job artifact', @@ -31,7 +33,8 @@ class ImportOptions { boolean flatten = false, boolean includemetainfilter = true, boolean clean = true, - appendtoparentmeta = true) { + appendtoparentmeta = true, + show = false) { m_script = script m_sourceselect = sourceselect.trim() m_incrementversionnumber = incrementversionnumber @@ -43,6 +46,7 @@ class ImportOptions { m_includemetainfilter = includemetainfilter m_clean = clean m_appendtoparentmeta = appendtoparentmeta + m_showdetails = show } String show() { @@ -281,7 +285,9 @@ def artifactimportfromrepo(meta, ImportOptions importoptions, String destpath) { } def artifactimport(meta, ImportOptions importoptions, String destpath) { - echo "Importing artifacts: Import options:\n${importoptions.show()}\n to: ${destpath}" + if (importoptions.m_show) { + echo "Importing artifacts:\nImport options:\n${importoptions.show()}\nto: ${destpath}" + } switch (importoptions.m_sourceselect) { case 'Jenkins job artifact': case 'Jenkins job artefact': diff --git a/install/installhelper.groovy b/install/installhelper.groovy index 96a8b2e..2915d0c 100644 --- a/install/installhelper.groovy +++ b/install/installhelper.groovy @@ -26,6 +26,7 @@ def copyToFinalPosition(String pathToIntermediate, String finalBaseFolder, Strin def Map artifactsImporter(meta, importer, artifactDetails, installerDetails) { artifactFetched = [:] + echo ("artifactDetails:\n${artifactDetails}\ninstallerDetails:\n${installerDetails}") def importoptions = importer.getNewImportOptions() for (installer in toBuild) { def artifactKeys = installerDetails.get(installer)[1] From d70f63344e8faef8448b5267eca6093bde946145 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Thu, 13 Jan 2022 14:21:53 +0000 Subject: [PATCH 171/182] CORE-594 - Debug installer creation --- import/importer.groovy | 10 +++++++--- install/installhelper.groovy | 3 ++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/import/importer.groovy b/import/importer.groovy index d6fb4d4..4948cad 100644 --- a/import/importer.groovy +++ b/import/importer.groovy @@ -34,7 +34,7 @@ class ImportOptions { boolean includemetainfilter = true, boolean clean = true, appendtoparentmeta = true, - show = false) { + showdetails = false) { m_script = script m_sourceselect = sourceselect.trim() m_incrementversionnumber = incrementversionnumber @@ -46,7 +46,7 @@ class ImportOptions { m_includemetainfilter = includemetainfilter m_clean = clean m_appendtoparentmeta = appendtoparentmeta - m_showdetails = show + m_showdetails = showdetails } String show() { @@ -147,6 +147,10 @@ class ImportOptions { releaserepo(repo, revision) setsourceselect(sourceselect) } + + void showdetails(boolean showdetails) { + m_showdetails = showdetails + } } ImportOptions getNewImportOptions() { @@ -285,7 +289,7 @@ def artifactimportfromrepo(meta, ImportOptions importoptions, String destpath) { } def artifactimport(meta, ImportOptions importoptions, String destpath) { - if (importoptions.m_show) { + if (importoptions.m_showdetails) { echo "Importing artifacts:\nImport options:\n${importoptions.show()}\nto: ${destpath}" } switch (importoptions.m_sourceselect) { diff --git a/install/installhelper.groovy b/install/installhelper.groovy index 2915d0c..9c11499 100644 --- a/install/installhelper.groovy +++ b/install/installhelper.groovy @@ -23,11 +23,12 @@ def copyToFinalPosition(String pathToIntermediate, String finalBaseFolder, Strin } // Given details about artifacts to import and details of installers to build, import artifacts that are required -def Map artifactsImporter(meta, importer, artifactDetails, installerDetails) { +def Map artifactsImporter(meta, importer, artifactDetails, installerDetails, boolean showdetails = false) { artifactFetched = [:] echo ("artifactDetails:\n${artifactDetails}\ninstallerDetails:\n${installerDetails}") def importoptions = importer.getNewImportOptions() + importoptions.showdetails(showdetails) for (installer in toBuild) { def artifactKeys = installerDetails.get(installer)[1] if (artifactKeys instanceof java.lang.String) { From 05a32d03f832828ddca41325ef2b6b9934b2aebc Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Thu, 13 Jan 2022 14:29:40 +0000 Subject: [PATCH 172/182] CORE-594 - Debug installer creation --- install/installhelper.groovy | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/install/installhelper.groovy b/install/installhelper.groovy index 9c11499..214fa84 100644 --- a/install/installhelper.groovy +++ b/install/installhelper.groovy @@ -26,7 +26,9 @@ def copyToFinalPosition(String pathToIntermediate, String finalBaseFolder, Strin def Map artifactsImporter(meta, importer, artifactDetails, installerDetails, boolean showdetails = false) { artifactFetched = [:] - echo ("artifactDetails:\n${artifactDetails}\ninstallerDetails:\n${installerDetails}") + if (showdetails) { + echo ("toBuild:\n${toBuild}\nartifactDetails:\n${artifactDetails}\ninstallerDetails:\n${installerDetails}") + } def importoptions = importer.getNewImportOptions() importoptions.showdetails(showdetails) for (installer in toBuild) { From d2820996984068d8632ff5060ec3fd1c0758a699 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Thu, 13 Jan 2022 14:36:22 +0000 Subject: [PATCH 173/182] CORE-594 - Debug installer creation --- install/installhelper.groovy | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/install/installhelper.groovy b/install/installhelper.groovy index 214fa84..a637fac 100644 --- a/install/installhelper.groovy +++ b/install/installhelper.groovy @@ -32,10 +32,17 @@ def Map artifactsImporter(meta, importer, artifactDetails, installerDetails, boo def importoptions = importer.getNewImportOptions() importoptions.showdetails(showdetails) for (installer in toBuild) { - def artifactKeys = installerDetails.get(installer)[1] + def installerinfo = installerDetails.get(installer) + if (showdetails) { + echo ("installer:\n${installer}\installerinfo:\n${installerinfo}") + } + def artifactKeys = installerinfo[1] if (artifactKeys instanceof java.lang.String) { artifactKeys = [ artifactKeys ] } + if (showdetails) { + echo ("artifactKeys:\n${artifactKeys}") + } for (artifactKey in artifactKeys) { (sourceProject, sourceselector, destFolder, incrementversionnumber, toCopy, notToCopy, binariesFolders) = artifactDetails.get(artifactKey) if (artifactFetched.get(artifactKey) == null) { From f1987cb9f47afdbdcefdc545567b71d86fee0c9d Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Thu, 13 Jan 2022 14:38:48 +0000 Subject: [PATCH 174/182] CORE-594 - Debug installer creation --- install/installhelper.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/installhelper.groovy b/install/installhelper.groovy index a637fac..926775e 100644 --- a/install/installhelper.groovy +++ b/install/installhelper.groovy @@ -34,7 +34,7 @@ def Map artifactsImporter(meta, importer, artifactDetails, installerDetails, boo for (installer in toBuild) { def installerinfo = installerDetails.get(installer) if (showdetails) { - echo ("installer:\n${installer}\installerinfo:\n${installerinfo}") + echo ("installer:\n${installer}\ninstallerinfo:\n${installerinfo}") } def artifactKeys = installerinfo[1] if (artifactKeys instanceof java.lang.String) { From fb721bb774e5a849d316aea9939bb4ddc491fe92 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Thu, 13 Jan 2022 14:44:49 +0000 Subject: [PATCH 175/182] CORE-594 - Debug installer creation --- install/installhelper.groovy | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/install/installhelper.groovy b/install/installhelper.groovy index 926775e..3a1cd23 100644 --- a/install/installhelper.groovy +++ b/install/installhelper.groovy @@ -44,7 +44,11 @@ def Map artifactsImporter(meta, importer, artifactDetails, installerDetails, boo echo ("artifactKeys:\n${artifactKeys}") } for (artifactKey in artifactKeys) { - (sourceProject, sourceselector, destFolder, incrementversionnumber, toCopy, notToCopy, binariesFolders) = artifactDetails.get(artifactKey) + artifactDetail = artifactDetails.get(artifactKey) + if (showdetails) { + echo ("artifactKey: ${artifactKey}\nartifactDetail:\n${artifactDetail}") + } + (sourceProject, sourceselector, destFolder, incrementversionnumber, toCopy, notToCopy, binariesFolders) = artifactDetail if (artifactFetched.get(artifactKey) == null) { importoptions.jenkinsjob(sourceProject, sourceselector) importoptions.setincrementversionnumber(incrementversionnumber) From eda480161f3b55b34ed217607eaf978fd5b425df Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Thu, 13 Jan 2022 15:12:47 +0000 Subject: [PATCH 176/182] CORE-594 - Debug installer creation --- install/installhelper.groovy | 3 +++ 1 file changed, 3 insertions(+) diff --git a/install/installhelper.groovy b/install/installhelper.groovy index 3a1cd23..77b917c 100644 --- a/install/installhelper.groovy +++ b/install/installhelper.groovy @@ -60,6 +60,9 @@ def Map artifactsImporter(meta, importer, artifactDetails, installerDetails, boo } } } + if (showdetails) { + echo ("artifactFetched:\n${artifactFetched}") + } return artifactFetched } From cdd00fdeefd8663a92cf303d3cbc6d4e88ce754d Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Thu, 13 Jan 2022 16:28:00 +0000 Subject: [PATCH 177/182] CORE-594 - Debug installer creation --- install/installhelper.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/installhelper.groovy b/install/installhelper.groovy index 77b917c..6763cb1 100644 --- a/install/installhelper.groovy +++ b/install/installhelper.groovy @@ -23,7 +23,7 @@ def copyToFinalPosition(String pathToIntermediate, String finalBaseFolder, Strin } // Given details about artifacts to import and details of installers to build, import artifacts that are required -def Map artifactsImporter(meta, importer, artifactDetails, installerDetails, boolean showdetails = false) { +def Map artifactsImporter(meta, importer, toBuild, artifactDetails, installerDetails, boolean showdetails = false) { artifactFetched = [:] if (showdetails) { From 6a415afe26eaa813ef1a5df891b9cfc52f1ee2ce Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Thu, 13 Jan 2022 18:46:33 +0000 Subject: [PATCH 178/182] CORE-594 - Debug installer creation --- install/installhelper.groovy | 1 + 1 file changed, 1 insertion(+) diff --git a/install/installhelper.groovy b/install/installhelper.groovy index 6763cb1..57fe65b 100644 --- a/install/installhelper.groovy +++ b/install/installhelper.groovy @@ -111,6 +111,7 @@ def checkISMfilebackend(String xml) { def checkISMfile(String ISMfile) { echo "Checking ISM file: ${ISMfile}" def xml = readFile(ISMfile) + echo "ISM file xml: ${xml}" (exitcode, message) = checkISMfilebackend(xml) echo message if (exitcode > 0) { From 951032de5a24f774f294d2241e67ad4260b9301a Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Thu, 13 Jan 2022 22:17:14 +0000 Subject: [PATCH 179/182] CORE-594 - Debug installer creation --- install/installhelper.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/installhelper.groovy b/install/installhelper.groovy index 57fe65b..8dbf23e 100644 --- a/install/installhelper.groovy +++ b/install/installhelper.groovy @@ -111,7 +111,7 @@ def checkISMfilebackend(String xml) { def checkISMfile(String ISMfile) { echo "Checking ISM file: ${ISMfile}" def xml = readFile(ISMfile) - echo "ISM file xml: ${xml}" + //echo "ISM file xml: ${xml}" (exitcode, message) = checkISMfilebackend(xml) echo message if (exitcode > 0) { From 8e15e7b6ce1690fadd187ac6542a82c78a8c0831 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Fri, 14 Jan 2022 10:21:06 +0000 Subject: [PATCH 180/182] CORE-594 - Import artifacts using full name --- artifacts/metaexport.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/artifacts/metaexport.groovy b/artifacts/metaexport.groovy index 8e5e56e..a40e9a8 100644 --- a/artifacts/metaexport.groovy +++ b/artifacts/metaexport.groovy @@ -4,7 +4,7 @@ def combineSubjobArtifacts(meta, importer, subJobs) { for (subJob in subJobs) { def subJobObject = subJob[0] if (subJobObject != null) { - def subJobName = subJobObject.getProjectName() + def subJobName = subJobObject.getFullProjectName() def subJobNumber = subJobObject.getNumber() def destFolder = subJob[1] def boolean incrementversionnumber = subJob[2] From e67bec14df6246631ef9e22fb06e16ed83c2527e Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sat, 15 Jan 2022 21:04:36 +0000 Subject: [PATCH 181/182] When doing nested release repo imports - ignore components that have incomplete release info --- import/importer.groovy | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/import/importer.groovy b/import/importer.groovy index 4948cad..90383b0 100644 --- a/import/importer.groovy +++ b/import/importer.groovy @@ -239,15 +239,18 @@ 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() != '___' && + 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()}" From b9f524061526dddd68e2195f4031e837a4232b53 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sun, 16 Jan 2022 23:03:35 +0000 Subject: [PATCH 182/182] / missing when doing hierarchical release repo checkout --- import/importer.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/import/importer.groovy b/import/importer.groovy index 4948cad..133cd10 100644 --- a/import/importer.groovy +++ b/import/importer.groovy @@ -245,7 +245,7 @@ def hierarchyartifactimportfromrepo(meta, ImportOptions importoptions, String de gh.stripgithistory(clonepath) - def metafilepath = "${clonepath}${relatedmeta.metafilepath()}" + def metafilepath = "${clonepath}/${relatedmeta.metafilepath()}" echo "Marking related meta as released and rewriting meta file: ${metafilepath}" rewritemetafileasreleased(relatedmeta, metafilepath) }