From 82d62ce93f2ef11fd41ad759598b1df243955964 Mon Sep 17 00:00:00 2001 From: Anna Matczak Date: Fri, 22 May 2020 12:41:18 +0000 Subject: [PATCH 001/153] testing --- artifacts/metaexport.groovy | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/artifacts/metaexport.groovy b/artifacts/metaexport.groovy index 67d13c3..5a43292 100644 --- a/artifacts/metaexport.groovy +++ b/artifacts/metaexport.groovy @@ -1,6 +1,5 @@ - // Take a list of Sub-job descriptors and output folder pairs, copy the artifacts, while filling in a string of artifact folders -def combineSubjobArtifacts(meta, importer, subJobs) { +def combineSubjobArtifacts(meta, subJobs) { def ArrayList artifactFolders = new ArrayList() for (subJob in subJobs) { def subJobObject = subJob[0] @@ -12,7 +11,7 @@ def combineSubjobArtifacts(meta, importer, subJobs) { dir(destFolder) { deleteDir() } - importer.artifactimport(meta, subJobName, subJobNumber, destFolder, incrementversionnumber) + //importer.artifactimport(meta, subJobName, subJobNumber, destFolder, incrementversionnumber) artifactFolders.add("${destFolder}/**") } } From e8489e716781323ccfd08a6f143ebc72ba3606e4 Mon Sep 17 00:00:00 2001 From: Anna Matczak Date: Tue, 26 May 2020 15:15:17 +0000 Subject: [PATCH 002/153] Revert temporary changes --- artifacts/metaexport.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/artifacts/metaexport.groovy b/artifacts/metaexport.groovy index 5a43292..f082d3a 100644 --- a/artifacts/metaexport.groovy +++ b/artifacts/metaexport.groovy @@ -11,7 +11,7 @@ def combineSubjobArtifacts(meta, subJobs) { dir(destFolder) { deleteDir() } - //importer.artifactimport(meta, subJobName, subJobNumber, destFolder, incrementversionnumber) + importer.artifactimport(meta, subJobName, subJobNumber, destFolder, incrementversionnumber) artifactFolders.add("${destFolder}/**") } } From 5ae85f47accd66747ad67654cd3f6fcf7393f9ba Mon Sep 17 00:00:00 2001 From: Anna Matczak Date: Tue, 26 May 2020 15:15:50 +0000 Subject: [PATCH 003/153] Update metaexport.groovy --- artifacts/metaexport.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/artifacts/metaexport.groovy b/artifacts/metaexport.groovy index f082d3a..4d93cc5 100644 --- a/artifacts/metaexport.groovy +++ b/artifacts/metaexport.groovy @@ -1,5 +1,5 @@ // Take a list of Sub-job descriptors and output folder pairs, copy the artifacts, while filling in a string of artifact folders -def combineSubjobArtifacts(meta, subJobs) { +def combineSubjobArtifacts(meta, importer, subJobs) { def ArrayList artifactFolders = new ArrayList() for (subJob in subJobs) { def subJobObject = subJob[0] From 37bf1354b98ea2496749c2111bdc76fea838fd6a Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sat, 30 Oct 2021 11:27:56 +0100 Subject: [PATCH 004/153] Remove redundant condition - try with short unstable builds --- autobuilder.groovy | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/autobuilder.groovy b/autobuilder.groovy index e3bc4d1..a587c70 100644 --- a/autobuilder.groovy +++ b/autobuilder.groovy @@ -107,22 +107,12 @@ def startbuild( return meta } -// DEPRECATED Metod, Use StartBuild Instead. +// DEPRECATED Method, Use StartBuild Instead. def start( - script, - String productname = PRODUCT_NAME, - String subcomponentname = SUBCOMPONENT_NAME, - String jirakey = JIRA_KEY, - String releaserepo = RELEASE_REPO, - String repoRootSuffix = "", - String autobuildpath = autobuildroot, - String commonscriptspath = commonscriptsroot - ) { - echo "DEPRECATED method: start(script, String productname = PRODUCT_NAME, subcomponentname = SUBCOMPONENT_NAME, jirakey = JIRA_KEY, ...)" - return startbuild(script, productname, subcomponentname, releaserepo, autobuildpath, commonscriptspath) + error "DEPRECATED method - deleted - start(script, String productname = PRODUCT_NAME, subcomponentname = SUBCOMPONENT_NAME, jirakey = JIRA_KEY, ...)" } -// Start up boilderplate +// Start up boilerplate def startnonbuild( script, autobuildpath = autobuildroot, From e4bc007e7d26f3203a70327952364953201d7ae4 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sat, 30 Oct 2021 11:30:33 +0100 Subject: [PATCH 005/153] Remove deprecated method --- autobuilder.groovy | 5 ----- 1 file changed, 5 deletions(-) diff --git a/autobuilder.groovy b/autobuilder.groovy index a587c70..2c6c4c4 100644 --- a/autobuilder.groovy +++ b/autobuilder.groovy @@ -107,11 +107,6 @@ def startbuild( return meta } -// DEPRECATED Method, Use StartBuild Instead. -def start( - error "DEPRECATED method - deleted - start(script, String productname = PRODUCT_NAME, subcomponentname = SUBCOMPONENT_NAME, jirakey = JIRA_KEY, ...)" -} - // Start up boilerplate def startnonbuild( script, From 7fda62fc3dbd924a7b1270d9d6378a03e1c66ddf Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sun, 31 Oct 2021 08:38:09 +0000 Subject: [PATCH 006/153] Move post build actions to Common scripts --- build/postactions.groovy | 55 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 build/postactions.groovy diff --git a/build/postactions.groovy b/build/postactions.groovy new file mode 100644 index 0000000..5a9ea09 --- /dev/null +++ b/build/postactions.groovy @@ -0,0 +1,55 @@ + +def performSuccessfulBuildActions() { + if (DOXYGEN_DEPLOY_JOB) { + build( + wait: false, + job: DOXYGEN_DEPLOY_JOB, + parameters: [ + string(name: 'BUILD_JOB_WITH_DOXYGEN_ARTIFACTS', value: JOB_NAME), + string(name: 'BUILD_JOB_WITH_DOXYGEN_ARTIFACTS_SELECTOR', value: " ${BUILD_NUMBER}"), + ] + ) + } + if (STATIC_ANALYSIS_JOB) { + build( + wait: false, + job: STATIC_ANALYSIS_JOB, + parameters: [ + string(name: 'APPLICATION_ARTIFACT_PROJECT', value: JOB_NAME), + string(name: 'APPLICATION_ARTIFACT_SELECTOR', value: " ${BUILD_NUMBER}"), + ] + ) + } + if (UNIT_TEST_JOB) { + build( + wait: false, + job: UNIT_TEST_JOB, + parameters: [ + string(name: 'APPLICATION_ARTIFACT_PROJECT', value: JOB_NAME), + string(name: 'APPLICATION_ARTIFACT_SELECTOR', value: " ${BUILD_NUMBER}"), + ] + ) + } + if (REGRESSION_TEST_JOB) { + build( + wait: false, + job: REGRESSION_TEST_JOB, + parameters: [ + string(name: 'APPLICATION_ARTIFACT_PROJECT', value: JOB_NAME), + string(name: 'APPLICATION_ARTIFACT_SELECTOR', value: " ${BUILD_NUMBER}"), + ] + ) + } + if (RELEASE_TO_GIT_JOB) { + build( + wait: false, + job: RELEASE_TO_GIT_JOB, + parameters: [ + string(name: 'BUILD_JOB', value: JOB_NAME), + string(name: 'BUILD_JOB_SELECTOR', value: " ${BUILD_NUMBER}"), + ] + ) + } +} + +return this; From 9711fd7b237ce6a62646c1afc00e91427a262a14 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Mon, 1 Nov 2021 07:35:25 +0000 Subject: [PATCH 007/153] Handle disabled post action jobs; Handle lack of FULLBUILD parameter --- build/postactions.groovy | 90 ++++++++++++++++++++++------------------ 1 file changed, 50 insertions(+), 40 deletions(-) diff --git a/build/postactions.groovy b/build/postactions.groovy index 5a9ea09..b7b027f 100644 --- a/build/postactions.groovy +++ b/build/postactions.groovy @@ -1,54 +1,64 @@ def performSuccessfulBuildActions() { if (DOXYGEN_DEPLOY_JOB) { - build( - wait: false, - job: DOXYGEN_DEPLOY_JOB, - parameters: [ - string(name: 'BUILD_JOB_WITH_DOXYGEN_ARTIFACTS', value: JOB_NAME), - string(name: 'BUILD_JOB_WITH_DOXYGEN_ARTIFACTS_SELECTOR', value: " ${BUILD_NUMBER}"), - ] - ) + if (Jenkins.instance.getItem(DOXYGEN_DEPLOY_JOB).isBuildable()) { + build( + wait: false, + job: DOXYGEN_DEPLOY_JOB, + parameters: [ + string(name: 'BUILD_JOB_WITH_DOXYGEN_ARTIFACTS', value: JOB_NAME), + string(name: 'BUILD_JOB_WITH_DOXYGEN_ARTIFACTS_SELECTOR', value: " ${BUILD_NUMBER}"), + ] + ) + } } if (STATIC_ANALYSIS_JOB) { - build( - wait: false, - job: STATIC_ANALYSIS_JOB, - parameters: [ - string(name: 'APPLICATION_ARTIFACT_PROJECT', value: JOB_NAME), - string(name: 'APPLICATION_ARTIFACT_SELECTOR', value: " ${BUILD_NUMBER}"), - ] - ) + if (Jenkins.instance.getItem(STATIC_ANALYSIS_JOB).isBuildable()) { + build( + wait: false, + job: STATIC_ANALYSIS_JOB, + parameters: [ + string(name: 'APPLICATION_ARTIFACT_PROJECT', value: JOB_NAME), + string(name: 'APPLICATION_ARTIFACT_SELECTOR', value: " ${BUILD_NUMBER}"), + ] + ) + } } if (UNIT_TEST_JOB) { - build( - wait: false, - job: UNIT_TEST_JOB, - parameters: [ - string(name: 'APPLICATION_ARTIFACT_PROJECT', value: JOB_NAME), - string(name: 'APPLICATION_ARTIFACT_SELECTOR', value: " ${BUILD_NUMBER}"), - ] - ) + if (Jenkins.instance.getItem(UNIT_TEST_JOB).isBuildable()) { + build( + wait: false, + job: UNIT_TEST_JOB, + parameters: [ + string(name: 'APPLICATION_ARTIFACT_PROJECT', value: JOB_NAME), + string(name: 'APPLICATION_ARTIFACT_SELECTOR', value: " ${BUILD_NUMBER}"), + ] + ) + } } if (REGRESSION_TEST_JOB) { - build( - wait: false, - job: REGRESSION_TEST_JOB, - parameters: [ - string(name: 'APPLICATION_ARTIFACT_PROJECT', value: JOB_NAME), - string(name: 'APPLICATION_ARTIFACT_SELECTOR', value: " ${BUILD_NUMBER}"), - ] - ) + if (Jenkins.instance.getItem(REGRESSION_TEST_JOB).isBuildable()) { + build( + wait: false, + job: REGRESSION_TEST_JOB, + parameters: [ + string(name: 'APPLICATION_ARTIFACT_PROJECT', value: JOB_NAME), + string(name: 'APPLICATION_ARTIFACT_SELECTOR', value: " ${BUILD_NUMBER}"), + ] + ) + } } if (RELEASE_TO_GIT_JOB) { - build( - wait: false, - job: RELEASE_TO_GIT_JOB, - parameters: [ - string(name: 'BUILD_JOB', value: JOB_NAME), - string(name: 'BUILD_JOB_SELECTOR', value: " ${BUILD_NUMBER}"), - ] - ) + if (Jenkins.instance.getItem(RELEASE_TO_GIT_JOB).isBuildable()) { + build( + wait: false, + job: RELEASE_TO_GIT_JOB, + parameters: [ + string(name: 'BUILD_JOB', value: JOB_NAME), + string(name: 'BUILD_JOB_SELECTOR', value: " ${BUILD_NUMBER}"), + ] + ) + } } } From 88a4a3b41df407a8f0bbd3687451174bc4158334 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Mon, 1 Nov 2021 07:39:10 +0000 Subject: [PATCH 008/153] Handle disabled post action jobs; Handle lack of FULLBUILD parameter --- build/postactions.groovy | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/build/postactions.groovy b/build/postactions.groovy index b7b027f..6bac803 100644 --- a/build/postactions.groovy +++ b/build/postactions.groovy @@ -1,6 +1,6 @@ def performSuccessfulBuildActions() { - if (DOXYGEN_DEPLOY_JOB) { + if (params.DOXYGEN_DEPLOY_JOB != null && DOXYGEN_DEPLOY_JOB) { if (Jenkins.instance.getItem(DOXYGEN_DEPLOY_JOB).isBuildable()) { build( wait: false, @@ -12,7 +12,7 @@ def performSuccessfulBuildActions() { ) } } - if (STATIC_ANALYSIS_JOB) { + if (params.STATIC_ANALYSIS_JOB != null && STATIC_ANALYSIS_JOB) { if (Jenkins.instance.getItem(STATIC_ANALYSIS_JOB).isBuildable()) { build( wait: false, @@ -25,7 +25,7 @@ def performSuccessfulBuildActions() { } } if (UNIT_TEST_JOB) { - if (Jenkins.instance.getItem(UNIT_TEST_JOB).isBuildable()) { + if (params.UNIT_TEST_JOB != null && Jenkins.instance.getItem(UNIT_TEST_JOB).isBuildable()) { build( wait: false, job: UNIT_TEST_JOB, @@ -37,7 +37,7 @@ def performSuccessfulBuildActions() { } } if (REGRESSION_TEST_JOB) { - if (Jenkins.instance.getItem(REGRESSION_TEST_JOB).isBuildable()) { + if (params.REGRESSION_TEST_JOB != null && Jenkins.instance.getItem(REGRESSION_TEST_JOB).isBuildable()) { build( wait: false, job: REGRESSION_TEST_JOB, @@ -48,7 +48,7 @@ def performSuccessfulBuildActions() { ) } } - if (RELEASE_TO_GIT_JOB) { + if (params.RELEASE_TO_GIT_JOB != null && RELEASE_TO_GIT_JOB) { if (Jenkins.instance.getItem(RELEASE_TO_GIT_JOB).isBuildable()) { build( wait: false, From 0ae743b16fdabbbd9266cc47411e68ec17364ae9 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 2 Nov 2021 22:18:49 +0000 Subject: [PATCH 009/153] Check status of jobs --- build/postactions.groovy | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/build/postactions.groovy b/build/postactions.groovy index 6bac803..d0c10e5 100644 --- a/build/postactions.groovy +++ b/build/postactions.groovy @@ -1,7 +1,7 @@ def performSuccessfulBuildActions() { if (params.DOXYGEN_DEPLOY_JOB != null && DOXYGEN_DEPLOY_JOB) { - if (Jenkins.instance.getItem(DOXYGEN_DEPLOY_JOB).isBuildable()) { + if (Jenkins.instance.getItemByFullName(DOXYGEN_DEPLOY_JOB).isBuildable()) { build( wait: false, job: DOXYGEN_DEPLOY_JOB, @@ -13,7 +13,7 @@ def performSuccessfulBuildActions() { } } if (params.STATIC_ANALYSIS_JOB != null && STATIC_ANALYSIS_JOB) { - if (Jenkins.instance.getItem(STATIC_ANALYSIS_JOB).isBuildable()) { + if (Jenkins.instance.getItemByFullName(STATIC_ANALYSIS_JOB).isBuildable()) { build( wait: false, job: STATIC_ANALYSIS_JOB, @@ -25,7 +25,7 @@ def performSuccessfulBuildActions() { } } if (UNIT_TEST_JOB) { - if (params.UNIT_TEST_JOB != null && Jenkins.instance.getItem(UNIT_TEST_JOB).isBuildable()) { + if (params.UNIT_TEST_JOB != null && Jenkins.instance.getItemByFullName(UNIT_TEST_JOB).isBuildable()) { build( wait: false, job: UNIT_TEST_JOB, @@ -37,7 +37,7 @@ def performSuccessfulBuildActions() { } } if (REGRESSION_TEST_JOB) { - if (params.REGRESSION_TEST_JOB != null && Jenkins.instance.getItem(REGRESSION_TEST_JOB).isBuildable()) { + if (params.REGRESSION_TEST_JOB != null && Jenkins.instance.getItemByFullName(REGRESSION_TEST_JOB).isBuildable()) { build( wait: false, job: REGRESSION_TEST_JOB, @@ -49,7 +49,7 @@ def performSuccessfulBuildActions() { } } if (params.RELEASE_TO_GIT_JOB != null && RELEASE_TO_GIT_JOB) { - if (Jenkins.instance.getItem(RELEASE_TO_GIT_JOB).isBuildable()) { + if (Jenkins.instance.getItemByFullName(RELEASE_TO_GIT_JOB).isBuildable()) { build( wait: false, job: RELEASE_TO_GIT_JOB, From c9e0ee6b7ecbdd4d763da9f9ed0fb6af13abc29b Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Wed, 3 Nov 2021 08:16:53 +0000 Subject: [PATCH 010/153] Show new tags and their sha code before pushing during release process --- release/do.groovy | 1 + 1 file changed, 1 insertion(+) diff --git a/release/do.groovy b/release/do.groovy index 649e279..e0b9471 100644 --- a/release/do.groovy +++ b/release/do.groovy @@ -235,6 +235,7 @@ def boolean releasegittags(String postcommitshacode, ArrayList taglist) summaryappend("Rel Tag ") for (tag in taglist) { if (releasegittag(postcommitshacode, tag)) { + echo "Tag added: ${tag} with sha: ${postcommitshacode}" tagadded = true } } From d52de4b8cd6974fba4f5698d874eb6cdeec4b268 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Thu, 4 Nov 2021 07:27:52 +0000 Subject: [PATCH 011/153] Trigger various optional processes after a successful build --- build/postactions.groovy | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/build/postactions.groovy b/build/postactions.groovy index d0c10e5..48ca297 100644 --- a/build/postactions.groovy +++ b/build/postactions.groovy @@ -1,7 +1,7 @@ def performSuccessfulBuildActions() { - if (params.DOXYGEN_DEPLOY_JOB != null && DOXYGEN_DEPLOY_JOB) { - if (Jenkins.instance.getItemByFullName(DOXYGEN_DEPLOY_JOB).isBuildable()) { + if (params.DOXYGEN_DEPLOY_JOB != null) { + if (DOXYGEN_DEPLOY_JOB && Jenkins.instance.getItemByFullName(DOXYGEN_DEPLOY_JOB).isBuildable()) { build( wait: false, job: DOXYGEN_DEPLOY_JOB, @@ -12,8 +12,8 @@ def performSuccessfulBuildActions() { ) } } - if (params.STATIC_ANALYSIS_JOB != null && STATIC_ANALYSIS_JOB) { - if (Jenkins.instance.getItemByFullName(STATIC_ANALYSIS_JOB).isBuildable()) { + if (params.STATIC_ANALYSIS_JOB != null) { + if (STATIC_ANALYSIS_JOB && Jenkins.instance.getItemByFullName(STATIC_ANALYSIS_JOB).isBuildable()) { build( wait: false, job: STATIC_ANALYSIS_JOB, @@ -24,8 +24,8 @@ def performSuccessfulBuildActions() { ) } } - if (UNIT_TEST_JOB) { - if (params.UNIT_TEST_JOB != null && Jenkins.instance.getItemByFullName(UNIT_TEST_JOB).isBuildable()) { + if (params.UNIT_TEST_JOB != null) { + if (UNIT_TEST_JOB && Jenkins.instance.getItemByFullName(UNIT_TEST_JOB).isBuildable()) { build( wait: false, job: UNIT_TEST_JOB, @@ -36,8 +36,8 @@ def performSuccessfulBuildActions() { ) } } - if (REGRESSION_TEST_JOB) { - if (params.REGRESSION_TEST_JOB != null && Jenkins.instance.getItemByFullName(REGRESSION_TEST_JOB).isBuildable()) { + if (params.REGRESSION_TEST_JOB != null) { + if (REGRESSION_TEST_JOB && Jenkins.instance.getItemByFullName(REGRESSION_TEST_JOB).isBuildable()) { build( wait: false, job: REGRESSION_TEST_JOB, @@ -48,8 +48,8 @@ def performSuccessfulBuildActions() { ) } } - if (params.RELEASE_TO_GIT_JOB != null && RELEASE_TO_GIT_JOB) { - if (Jenkins.instance.getItemByFullName(RELEASE_TO_GIT_JOB).isBuildable()) { + if (params.RELEASE_TO_GIT_JOB != null) { + if (RELEASE_TO_GIT_JOB && Jenkins.instance.getItemByFullName(RELEASE_TO_GIT_JOB).isBuildable()) { build( wait: false, job: RELEASE_TO_GIT_JOB, From 718ebaa4183845682542a364045093962d3f5117 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Fri, 5 Nov 2021 18:06:02 +0000 Subject: [PATCH 012/153] Refactor groovy calling test script using newer common script apis; Transfer info across from build; Provide new interface for getting tools --- configuration/configuration.groovy | 81 ++++++++++++++++++++++++++++-- meta/folder.groovy | 14 ++++++ 2 files changed, 90 insertions(+), 5 deletions(-) diff --git a/configuration/configuration.groovy b/configuration/configuration.groovy index 2a7f1ab..9067018 100644 --- a/configuration/configuration.groovy +++ b/configuration/configuration.groovy @@ -1,18 +1,89 @@ gh = load("${autobuilder.commonscripts()}/versioncontrol/git.groovy") +String tool, String gitURL, String revision, String targetDir, String repoRoot = "", int cloneDepth = 1, boolean shallowClone = true, String filter = '' + + configurationhelper.gitCheckoutAndRegister( + meta, + 'xmlcoreutils', + XMLCOREUTILSURL, + XMLCOREUTILSREVISION, + XMLCOREUTILSDIR + ) + +class ToolOptions { + def m_script // Script to use if wanting to execute script commands (eg. echo -> script.echo) + + String m_toolName + + String m_gitURL + String m_revision + String m_repoRoot + int m_cloneDepth + boolean m_shallowClone + + ToolOptions(script) { + m_script = script + m_gitURL = '-' + m_revision = '-' + m_repoRoot = '' + m_cloneDepth = 1 + m_shallowClone = true + } + + void toolName(String name) { + m_toolName = name.trim() + } + + void toolRepo(String repo, String revision) { + m_repo = repo.trim() + m_revision = revision.trim() + } + + void repoRoot(String root) { + m_repoRoot = root.trim() + } + + void clonedepth(int depth) { + m_cloneDepth = depth + } + + void shallowclone(boolean shallow) { + m_shallowClone = shallow + } +} + +ToolOptions getNewToolOptions() { + return new ToolOptions(this) +} + def registerConfigurationInfo(meta, String configurationName, String configurationURL, String configurationVersion, String configurationSHA) { meta.addConfigurationInfo(configurationName, configurationURL, configurationVersion, configurationSHA) } def registerPipelineScriptConfiguration(meta) { - registerConfigurationInfo(meta, 'pipeline script', '-', '-', gh.getGitInfo(autobuilder.getautobuildpath())) + def options = getNewToolOptions() + + options.toolName('pipeline script'); + registerConfigurationInfo(meta, options.m_toolName, options.m_gitURL, options.m_revision, gh.getGitInfo(autobuilder.getautobuildpath())) } -def gitCheckoutAndRegister(meta, String tool, String gitURL, String revision, String targetDir, String repoRoot = "", int cloneDepth = 1, boolean shallowClone = true, String filter = '') { - def ArrayList sparseitemlist = gh.convertSparseItemsString(filter) - gh.gitCheckoutAlt(gitURL, revision, targetDir, repoRoot, cloneDepth, shallowClone) +def getTool(meta, ToolOptions options, String targetDir) { + gh.gitCheckoutAlt(options.m_gitURL, options.m_revision, targetDir, options.m_repoRoot, options.m_cloneDepth, options.m_shallowClone) - registerConfigurationInfo(meta, tool, gitURL, revision, gh.getGitInfo(targetDir)) + registerConfigurationInfo(meta, options.m_toolName, options.m_gitURL, options.m_revision, gh.getGitInfo(targetDir)) +} + +def gitCheckoutAndRegister(meta, String tool, String gitURL, String revision, String targetDir, String repoRoot = '', int cloneDepth = 1, boolean shallowClone = true, String filter = '') { + echo "DEPRECATED method: gitCheckoutAndRegister(meta,, String tool, String gitURL, String revision, String targetDir, String repoRoot = "", int cloneDepth = 1, ...)" + def options = getNewToolOptions() + + options.toolName(tool); + options.toolRepo(gitURL, revision) + options.repoRoot(repoRoot) + options.clonedepth(cloneDepth) + options.shallowclone(shallowClone) + + getTool(meta, options, targetDir) } return this diff --git a/meta/folder.groovy b/meta/folder.groovy index 6b5f8bc..7a85338 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -70,6 +70,12 @@ class ProductInfo extends GISJsonSerialised { this.variant = variant } + void set(ProductInfo otherinfo) { + this.productname = otherinfo.productname + this.subcomponentname = otherinfo.subcomponentname + this.variant = otherinfo.variant + } + void deserialiseJson(rawmeta) { productname = rawmeta['productname'] subcomponentname = rawmeta['subcomponentname'] @@ -110,6 +116,14 @@ class GitInfo extends GISJsonSerialised { this.remoteinfo = remoteinfo } + void set(GitInfo otherinfo) { + this.sourcepath = otherinfo.sourcepath + this.sourcerevision = otherinfo.sourcerevision + this.gitrevision = otherinfo.gitrevision + this.remoteurl = otherinfo.remoteurl + this.remoteinfo = otherinfo.remoteinfo + } + void deserialiseJson(rawmeta) { sourcepath = rawmeta['sourcepath'] sourcerevision = rawmeta['sourcerevision'] From a7f2de8b8695b543368a20f87a2736b579cfd2dc Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Fri, 5 Nov 2021 18:13:37 +0000 Subject: [PATCH 013/153] Refactor groovy calling test script using newer common script apis; Correct history folder --- configuration/configuration.groovy | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/configuration/configuration.groovy b/configuration/configuration.groovy index 9067018..ba03d31 100644 --- a/configuration/configuration.groovy +++ b/configuration/configuration.groovy @@ -1,15 +1,5 @@ gh = load("${autobuilder.commonscripts()}/versioncontrol/git.groovy") -String tool, String gitURL, String revision, String targetDir, String repoRoot = "", int cloneDepth = 1, boolean shallowClone = true, String filter = '' - - configurationhelper.gitCheckoutAndRegister( - meta, - 'xmlcoreutils', - XMLCOREUTILSURL, - XMLCOREUTILSREVISION, - XMLCOREUTILSDIR - ) - class ToolOptions { def m_script // Script to use if wanting to execute script commands (eg. echo -> script.echo) From fbd0c169d9c8c1ea2a4a00df6af25e5fa6c9e2fd Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Fri, 5 Nov 2021 18:47:38 +0000 Subject: [PATCH 014/153] Refactor groovy calling test script using newer common script apis; Seperate scripts --- configuration/configuration.groovy | 71 +++--------------------------- configuration/tools.groovy | 59 +++++++++++++++++++++++++ 2 files changed, 64 insertions(+), 66 deletions(-) create mode 100644 configuration/tools.groovy diff --git a/configuration/configuration.groovy b/configuration/configuration.groovy index ba03d31..2a7f1ab 100644 --- a/configuration/configuration.groovy +++ b/configuration/configuration.groovy @@ -1,79 +1,18 @@ gh = load("${autobuilder.commonscripts()}/versioncontrol/git.groovy") -class ToolOptions { - def m_script // Script to use if wanting to execute script commands (eg. echo -> script.echo) - - String m_toolName - - String m_gitURL - String m_revision - String m_repoRoot - int m_cloneDepth - boolean m_shallowClone - - ToolOptions(script) { - m_script = script - m_gitURL = '-' - m_revision = '-' - m_repoRoot = '' - m_cloneDepth = 1 - m_shallowClone = true - } - - void toolName(String name) { - m_toolName = name.trim() - } - - void toolRepo(String repo, String revision) { - m_repo = repo.trim() - m_revision = revision.trim() - } - - void repoRoot(String root) { - m_repoRoot = root.trim() - } - - void clonedepth(int depth) { - m_cloneDepth = depth - } - - void shallowclone(boolean shallow) { - m_shallowClone = shallow - } -} - -ToolOptions getNewToolOptions() { - return new ToolOptions(this) -} - def registerConfigurationInfo(meta, String configurationName, String configurationURL, String configurationVersion, String configurationSHA) { meta.addConfigurationInfo(configurationName, configurationURL, configurationVersion, configurationSHA) } def registerPipelineScriptConfiguration(meta) { - def options = getNewToolOptions() - - options.toolName('pipeline script'); - registerConfigurationInfo(meta, options.m_toolName, options.m_gitURL, options.m_revision, gh.getGitInfo(autobuilder.getautobuildpath())) + registerConfigurationInfo(meta, 'pipeline script', '-', '-', gh.getGitInfo(autobuilder.getautobuildpath())) } -def getTool(meta, ToolOptions options, String targetDir) { - gh.gitCheckoutAlt(options.m_gitURL, options.m_revision, targetDir, options.m_repoRoot, options.m_cloneDepth, options.m_shallowClone) +def gitCheckoutAndRegister(meta, String tool, String gitURL, String revision, String targetDir, String repoRoot = "", int cloneDepth = 1, boolean shallowClone = true, String filter = '') { + def ArrayList sparseitemlist = gh.convertSparseItemsString(filter) + gh.gitCheckoutAlt(gitURL, revision, targetDir, repoRoot, cloneDepth, shallowClone) - registerConfigurationInfo(meta, options.m_toolName, options.m_gitURL, options.m_revision, gh.getGitInfo(targetDir)) -} - -def gitCheckoutAndRegister(meta, String tool, String gitURL, String revision, String targetDir, String repoRoot = '', int cloneDepth = 1, boolean shallowClone = true, String filter = '') { - echo "DEPRECATED method: gitCheckoutAndRegister(meta,, String tool, String gitURL, String revision, String targetDir, String repoRoot = "", int cloneDepth = 1, ...)" - def options = getNewToolOptions() - - options.toolName(tool); - options.toolRepo(gitURL, revision) - options.repoRoot(repoRoot) - options.clonedepth(cloneDepth) - options.shallowclone(shallowClone) - - getTool(meta, options, targetDir) + registerConfigurationInfo(meta, tool, gitURL, revision, gh.getGitInfo(targetDir)) } return this diff --git a/configuration/tools.groovy b/configuration/tools.groovy new file mode 100644 index 0000000..fbd34a6 --- /dev/null +++ b/configuration/tools.groovy @@ -0,0 +1,59 @@ +gh = load("${autobuilder.commonscripts()}/versioncontrol/git.groovy") + +class ToolOptions { + def m_script // Script to use if wanting to execute script commands (eg. echo -> script.echo) + + String m_toolName + + String m_gitURL + String m_revision + String m_repoRoot + int m_cloneDepth + boolean m_shallowClone + + ToolOptions(script) { + m_script = script + m_gitURL = '-' + m_revision = '-' + m_repoRoot = '' + m_cloneDepth = 1 + m_shallowClone = true + } + + void toolName(String name) { + m_toolName = name.trim() + } + + void toolRepo(String repo, String revision) { + m_repo = repo.trim() + m_revision = revision.trim() + } + + void repoRoot(String root) { + m_repoRoot = root.trim() + } + + void clonedepth(int depth) { + m_cloneDepth = depth + } + + void shallowclone(boolean shallow) { + m_shallowClone = shallow + } +} + +ToolOptions getNewToolOptions() { + return new ToolOptions(this) +} + +def registerConfigurationInfo(meta, String configurationName, String configurationURL, String configurationVersion, String configurationSHA) { + meta.addConfigurationInfo(configurationName, configurationURL, configurationVersion, configurationSHA) +} + +def getTool(meta, ToolOptions options, String targetDir) { + gh.gitCheckoutAlt(options.m_gitURL, options.m_revision, targetDir, options.m_repoRoot, options.m_cloneDepth, options.m_shallowClone) + + registerConfigurationInfo(meta, options.m_toolName, options.m_gitURL, options.m_revision, gh.getGitInfo(targetDir)) +} + +return this From 0c350d89588a2c96c77abf6e8c4a2a95a39d1224 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Fri, 5 Nov 2021 18:51:45 +0000 Subject: [PATCH 015/153] Refactor groovy calling test script using newer common script apis; Seperate scripts --- configuration/tools.groovy | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configuration/tools.groovy b/configuration/tools.groovy index fbd34a6..dbaeedb 100644 --- a/configuration/tools.groovy +++ b/configuration/tools.groovy @@ -24,8 +24,8 @@ class ToolOptions { m_toolName = name.trim() } - void toolRepo(String repo, String revision) { - m_repo = repo.trim() + void toolRepo(String gitURL, String revision) { + m_gitURL = gitURL.trim() m_revision = revision.trim() } From ea94dfa39e9b2c2c509c971fe86ee2999427f36f Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Fri, 5 Nov 2021 19:52:17 +0000 Subject: [PATCH 016/153] Refactor groovy calling test script using newer common script apis; Capture build parameters --- autobuilder.groovy | 26 ++++++++++++--------- meta/folder.groovy | 56 +++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 70 insertions(+), 12 deletions(-) diff --git a/autobuilder.groovy b/autobuilder.groovy index 2c6c4c4..59d1448 100644 --- a/autobuilder.groovy +++ b/autobuilder.groovy @@ -70,6 +70,19 @@ def setBuildType(meta, boolean dofullbuild = true) { return doquickbuild } +def setupmeta(String productname, String subcomponentname, String productvariant = '') { + def meta = getmetafolderscript().metareset(script) + echo "Product name: ${productname} Subcomponent name: ${subcomponentname} Variant: ${productvariant}" + meta.productinfo.set(productname, subcomponentname, productvariant) + def now = new Date() + now.format("yyMMdd.HHmm", TimeZone.getTimeZone('UTC')) + meta.jenkinsbuildinfo.set(JOB_NAME, BUILD_ID.toInteger(), NODE_NAME, now.toString()) + for (p in params) { + meta.jenkinsbuildinfo.addParameter(p.key, p.value) + } + return meta +} + // Start up boilerplate def startbuild( script, @@ -88,12 +101,7 @@ def startbuild( conditionalclean() - def meta = getmetafolderscript().metareset(script) - echo "Product name: ${productname} Subcomponent name: ${subcomponentname}" - meta.productinfo.set(productname, subcomponentname, productvariant) - def now = new Date() - now.format("yyMMdd.HHmm", TimeZone.getTimeZone('UTC')) - meta.jenkinsbuildinfo.set(JOB_NAME, BUILD_ID.toInteger(), NODE_NAME, now.toString()) + def meta = setupmeta(productname, subcomponentname, productvariant) { def rr = load("${commonscripts()}/release/registerrepo.groovy") def String alteredreleaserepo = alterreleaserepo(releaserepo, productvariant) @@ -121,11 +129,7 @@ def startnonbuild( conditionalclean() - def meta = getmetafolderscript().metareset(script) - meta.productinfo.set("Non-build-product", "Non-build-subcomponent") - def now = new Date() - now.format("yyMMdd.HHmm", TimeZone.getTimeZone('UTC')) - meta.jenkinsbuildinfo.set(JOB_NAME, BUILD_ID.toInteger(), NODE_NAME, now.toString()) + def meta = setupmeta("Non-build-product", "Non-build-subcomponent") { def ch = load("${commonscripts()}/configuration/configuration.groovy") ch.registerPipelineScriptConfiguration(meta) diff --git a/meta/folder.groovy b/meta/folder.groovy index 7a85338..e2b3015 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -144,11 +144,41 @@ class GitInfo extends GISJsonSerialised { } } +class JenkinsBuildParameter extends GISJsonSerialised { + private String name + private String value + + JenkinsBuildParameter(script, String name = '', String value = '') { + super(script) + this.name = name + this.value = value + } + + void set(String name, String value) { + this.name = name + this.value = value + } + + void deserialiseJson(rawmeta) { + name = rawmeta['name'] + value = rawmeta['value'] + } + + LinkedHashMap serialisationdata() { + def data = [ + 'name' : name, + 'value' : value, + ] + return data + } +} + class JenkinsBuildInfo extends GISJsonSerialised { String buildjobname int buildnumber private String buildmachine private String builddate + ArrayList parameters boolean isfullbuild JenkinsBuildInfo(script, String buildjobname = "", int buildnumber = 0, String buildmachine = "", String builddate = "", boolean isfullbuild = true) { @@ -158,6 +188,7 @@ class JenkinsBuildInfo extends GISJsonSerialised { this.buildmachine = buildmachine this.builddate = builddate this.isfullbuild = isfullbuild + parameters = new ArrayList() } void set(String buildjobname, int buildnumber, String buildmachine, String builddate, boolean isfullbuild = true) { @@ -176,12 +207,34 @@ class JenkinsBuildInfo extends GISJsonSerialised { return isfullbuild } + void addParameter(String name, String value) { + def p = new JenkinsBuildParameter(script, name, value) + parameters.add(p) + return p + } + void deserialiseJson(rawmeta) { buildjobname = rawmeta['buildjobname'] buildnumber = rawmeta['buildnumber'] buildmachine = rawmeta['buildmachine'] builddate = rawmeta['builddate'] isfullbuild = (rawmeta['isfullbuild'] == null) ? true : rawmeta['isfullbuild'] + parameters = new ArrayList() + if (rawmeta['isfullbuild'] != null) { + for (rawparameter in rawmeta['parameters']) { + def p = new JenkinsBuildParameter(script) + p.deserialiseJson(rawparameter) + parameters.add(p) + } + } + } + + List parametersserialised() { + def associated = [] + for (p in parameters) { + associated.add(p.serialisationdata()) + } + return associated } LinkedHashMap serialisationdata() { @@ -190,7 +243,8 @@ class JenkinsBuildInfo extends GISJsonSerialised { 'buildnumber' : buildnumber, 'buildmachine' : buildmachine, 'builddate' : builddate, - 'isfullbuild' : isfullbuild + 'isfullbuild' : isfullbuild, + 'parameters' : parametersserialised(), ] return data } From baacfdb417489eeaae368bff594e3af59412c20c Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Fri, 5 Nov 2021 19:59:46 +0000 Subject: [PATCH 017/153] Refactor groovy calling test script using newer common script apis; Capture build parameters --- autobuilder.groovy | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/autobuilder.groovy b/autobuilder.groovy index 59d1448..8e7eb27 100644 --- a/autobuilder.groovy +++ b/autobuilder.groovy @@ -101,7 +101,7 @@ def startbuild( conditionalclean() - def meta = setupmeta(productname, subcomponentname, productvariant) { + def meta = setupmeta(productname, subcomponentname, productvariant) def rr = load("${commonscripts()}/release/registerrepo.groovy") def String alteredreleaserepo = alterreleaserepo(releaserepo, productvariant) @@ -129,7 +129,7 @@ def startnonbuild( conditionalclean() - def meta = setupmeta("Non-build-product", "Non-build-subcomponent") { + def meta = setupmeta("Non-build-product", "Non-build-subcomponent") def ch = load("${commonscripts()}/configuration/configuration.groovy") ch.registerPipelineScriptConfiguration(meta) From 6299b7e7153271dc16b7985209bf7e3760b0f5da Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Fri, 5 Nov 2021 20:01:37 +0000 Subject: [PATCH 018/153] Refactor groovy calling test script using newer common script apis; Capture build parameters --- autobuilder.groovy | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/autobuilder.groovy b/autobuilder.groovy index 8e7eb27..667f89a 100644 --- a/autobuilder.groovy +++ b/autobuilder.groovy @@ -70,7 +70,7 @@ def setBuildType(meta, boolean dofullbuild = true) { return doquickbuild } -def setupmeta(String productname, String subcomponentname, String productvariant = '') { +def setupmeta(script, String productname, String subcomponentname, String productvariant = '') { def meta = getmetafolderscript().metareset(script) echo "Product name: ${productname} Subcomponent name: ${subcomponentname} Variant: ${productvariant}" meta.productinfo.set(productname, subcomponentname, productvariant) @@ -101,7 +101,7 @@ def startbuild( conditionalclean() - def meta = setupmeta(productname, subcomponentname, productvariant) + def meta = setupmeta(script, productname, subcomponentname, productvariant) def rr = load("${commonscripts()}/release/registerrepo.groovy") def String alteredreleaserepo = alterreleaserepo(releaserepo, productvariant) @@ -129,7 +129,7 @@ def startnonbuild( conditionalclean() - def meta = setupmeta("Non-build-product", "Non-build-subcomponent") + def meta = setupmeta(script, "Non-build-product", "Non-build-subcomponent") def ch = load("${commonscripts()}/configuration/configuration.groovy") ch.registerPipelineScriptConfiguration(meta) From a89688e44fa57a27b5389176cc1c7794b464f81b Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Fri, 5 Nov 2021 20:07:18 +0000 Subject: [PATCH 019/153] Refactor groovy calling test script using newer common script apis; Capture build parameters --- autobuilder.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autobuilder.groovy b/autobuilder.groovy index 667f89a..1a071e5 100644 --- a/autobuilder.groovy +++ b/autobuilder.groovy @@ -78,7 +78,7 @@ def setupmeta(script, String productname, String subcomponentname, String produc now.format("yyMMdd.HHmm", TimeZone.getTimeZone('UTC')) meta.jenkinsbuildinfo.set(JOB_NAME, BUILD_ID.toInteger(), NODE_NAME, now.toString()) for (p in params) { - meta.jenkinsbuildinfo.addParameter(p.key, p.value) + meta.jenkinsbuildinfo.addParameter(p.key, p.value.toString()) } return meta } From e7dace6cb0378fb5d6bf77ddf4d106f975d76f71 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sat, 6 Nov 2021 11:10:16 +0000 Subject: [PATCH 020/153] Add a new meta walker and test it --- build/integrity.groovy | 17 +++++++++++++++++ meta/folder.groovy | 14 ++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 build/integrity.groovy diff --git a/build/integrity.groovy b/build/integrity.groovy new file mode 100644 index 0000000..3f658a8 --- /dev/null +++ b/build/integrity.groovy @@ -0,0 +1,17 @@ + +def check(buildmeta) { + def results = [ + 'good': true, + 'comment': '', + ] + + // Walk the meta looking for different versions of the same components + def allmeta = buildmeta.allrelatedmeta() + echo "All meta:" + for (meta in allmeta) { + echo meta.componentversionuniqueidentifier() + } + return results +} + +return this \ No newline at end of file diff --git a/meta/folder.groovy b/meta/folder.groovy index e2b3015..63e2fa5 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -847,6 +847,20 @@ class MetaInfo extends GISJsonSerialised { return releasemetaversionuniquecollection } + ArrayList walkrelated(ArrayList metacollection) { + metacollection.add(this) + for (relatedmetainfo in associatedmeta) { + MetaInfo othermeta = relatedmetainfo.meta + metacollection = othermeta.walkrelated(metacollection) + } + return metacollection + } + + ArrayList allrelatedmeta() { + ArrayList metacollection = new ArrayList() + return walkrelated(metacollection) + } + MetaInfo getNewMetaObject(script) { return new MetaInfo(script) } From 04067e214d15eebdf574b58cb4f44f0cfb6f0990 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sat, 6 Nov 2021 11:49:23 +0000 Subject: [PATCH 021/153] Add a new meta walker and test it --- build/integrity.groovy | 4 ++-- meta/folder.groovy | 9 +++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/build/integrity.groovy b/build/integrity.groovy index 3f658a8..6fb9985 100644 --- a/build/integrity.groovy +++ b/build/integrity.groovy @@ -7,8 +7,8 @@ def check(buildmeta) { // Walk the meta looking for different versions of the same components def allmeta = buildmeta.allrelatedmeta() - echo "All meta:" - for (meta in allmeta) { + echo "All meta:\n${allmeta.comment}" + for (meta in allmeta.metacollection) { echo meta.componentversionuniqueidentifier() } return results diff --git a/meta/folder.groovy b/meta/folder.groovy index 63e2fa5..be4ac9f 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -847,16 +847,17 @@ class MetaInfo extends GISJsonSerialised { return releasemetaversionuniquecollection } - ArrayList walkrelated(ArrayList metacollection) { + def walkrelated(ArrayList metacollection, String comment = '', int level = 0) { metacollection.add(this) + comment += ''.padright(level) + componentversionuniqueidentifier() + '\n' for (relatedmetainfo in associatedmeta) { MetaInfo othermeta = relatedmetainfo.meta - metacollection = othermeta.walkrelated(metacollection) + results = othermeta.walkrelated(metacollection, comment, level + 1) } - return metacollection + return [ 'metacollection' : results.metacollection, 'comment': results.comment] } - ArrayList allrelatedmeta() { + def allrelatedmeta() { ArrayList metacollection = new ArrayList() return walkrelated(metacollection) } From b8a0c9641f0f61987da85de0b89072a1afcae117 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sat, 6 Nov 2021 12:41:40 +0000 Subject: [PATCH 022/153] Add a new meta walker and test it --- build/integrity.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/integrity.groovy b/build/integrity.groovy index 6fb9985..dd97e2b 100644 --- a/build/integrity.groovy +++ b/build/integrity.groovy @@ -7,7 +7,7 @@ def check(buildmeta) { // Walk the meta looking for different versions of the same components def allmeta = buildmeta.allrelatedmeta() - echo "All meta:\n${allmeta.comment}" + echo "All meta:\n${allmeta.comment}" for (meta in allmeta.metacollection) { echo meta.componentversionuniqueidentifier() } From 11d53250bffd1884e76010b9678f4167e46e9272 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sat, 6 Nov 2021 12:43:44 +0000 Subject: [PATCH 023/153] Add a new meta walker and test it --- meta/folder.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta/folder.groovy b/meta/folder.groovy index be4ac9f..d2e2ef8 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -849,7 +849,7 @@ class MetaInfo extends GISJsonSerialised { def walkrelated(ArrayList metacollection, String comment = '', int level = 0) { metacollection.add(this) - comment += ''.padright(level) + componentversionuniqueidentifier() + '\n' + comment += ''.padRight(level) + componentversionuniqueidentifier() + '\n' for (relatedmetainfo in associatedmeta) { MetaInfo othermeta = relatedmetainfo.meta results = othermeta.walkrelated(metacollection, comment, level + 1) From 9b773dd0c5eab71dc978a72103d1268227bea893 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sat, 6 Nov 2021 13:08:19 +0000 Subject: [PATCH 024/153] Add a new meta walker and test it --- meta/folder.groovy | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/meta/folder.groovy b/meta/folder.groovy index d2e2ef8..ced61c3 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -848,13 +848,17 @@ class MetaInfo extends GISJsonSerialised { } def walkrelated(ArrayList metacollection, String comment = '', int level = 0) { - metacollection.add(this) - comment += ''.padRight(level) + componentversionuniqueidentifier() + '\n' + def results = [ + 'metacollection' : metacollection, + 'comment': comment + ] + results.metacollection.add(this) + results.comment += ''.padRight(level) + componentversionuniqueidentifier() + '\n' for (relatedmetainfo in associatedmeta) { MetaInfo othermeta = relatedmetainfo.meta - results = othermeta.walkrelated(metacollection, comment, level + 1) + results = othermeta.walkrelated(results.metacollection, results.comment, level + 1) } - return [ 'metacollection' : results.metacollection, 'comment': results.comment] + return [ 'metacollection' : results.metacollection, 'comment': results.comment ] } def allrelatedmeta() { From e21cbf4d0369b573b776d28011c00dd5f37d9e7b Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sat, 6 Nov 2021 15:54:30 +0000 Subject: [PATCH 025/153] Add a new meta walker and test it --- build/integrity.groovy | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/build/integrity.groovy b/build/integrity.groovy index dd97e2b..161c503 100644 --- a/build/integrity.groovy +++ b/build/integrity.groovy @@ -8,8 +8,30 @@ def check(buildmeta) { // Walk the meta looking for different versions of the same components def allmeta = buildmeta.allrelatedmeta() echo "All meta:\n${allmeta.comment}" + + def productcomponents = [:] for (meta in allmeta.metacollection) { - echo meta.componentversionuniqueidentifier() + def key = meta.componentidentifier() + + if (!productcomponents.containsKey(key)) { + productcomponents[key] = [:] + } + def buildstampnumber = meta.releasetag() + if (!productcomponents[key].containsKey(buildstampnumber)) { + productcomponents[key][buildstampnumber] = 1 + } else { + productcomponents[key][buildstampnumber] += 1 + } + } + for (pc in productcomponents.keySet()) { + bsns = productcomponents[pc] + if (bsns.size() > 1) { + results.good = false + results.comment += "There is more than one version of Product component: ${pc} being used in this build:\n" + for (bsn in bsns.keySet()) { + comment += "${bsn}\n" + } + } } return results } From 670ade815d6c24488e83fe6bbdab779abd399e5d Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sat, 6 Nov 2021 16:00:24 +0000 Subject: [PATCH 026/153] Add a new meta walker and test it --- meta/folder.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta/folder.groovy b/meta/folder.groovy index ced61c3..c7ea7e3 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -853,7 +853,7 @@ class MetaInfo extends GISJsonSerialised { 'comment': comment ] results.metacollection.add(this) - results.comment += ''.padRight(level) + componentversionuniqueidentifier() + '\n' + results.comment += ''.padRight(level) + releasetag() + '\n' for (relatedmetainfo in associatedmeta) { MetaInfo othermeta = relatedmetainfo.meta results = othermeta.walkrelated(results.metacollection, results.comment, level + 1) From 7aa361b93dd156f682802b4b94e3e8fdde77d8ae Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sat, 6 Nov 2021 16:04:58 +0000 Subject: [PATCH 027/153] Add a new meta walker and test it --- meta/folder.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta/folder.groovy b/meta/folder.groovy index c7ea7e3..9672294 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -853,7 +853,7 @@ class MetaInfo extends GISJsonSerialised { 'comment': comment ] results.metacollection.add(this) - results.comment += ''.padRight(level) + releasetag() + '\n' + results.comment += ''.padRight(level) + globalreleasetag() + '\n' for (relatedmetainfo in associatedmeta) { MetaInfo othermeta = relatedmetainfo.meta results = othermeta.walkrelated(results.metacollection, results.comment, level + 1) From ee7c6e95de11d89c8e87bcf9b137a20b645bdee1 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sat, 6 Nov 2021 16:09:38 +0000 Subject: [PATCH 028/153] Add a new meta walker and test it --- build/integrity.groovy | 1 + 1 file changed, 1 insertion(+) diff --git a/build/integrity.groovy b/build/integrity.groovy index 161c503..739abce 100644 --- a/build/integrity.groovy +++ b/build/integrity.groovy @@ -23,6 +23,7 @@ def check(buildmeta) { productcomponents[key][buildstampnumber] += 1 } } + echo productcomponents.toString() for (pc in productcomponents.keySet()) { bsns = productcomponents[pc] if (bsns.size() > 1) { From 0073dc73bc7249e71e40005a7674ee508a0884ab Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sat, 6 Nov 2021 16:17:06 +0000 Subject: [PATCH 029/153] Add a new meta walker and test it --- build/integrity.groovy | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/build/integrity.groovy b/build/integrity.groovy index 739abce..fa7594f 100644 --- a/build/integrity.groovy +++ b/build/integrity.groovy @@ -1,4 +1,5 @@ - +import static groovy.json.JsonOutput.* + def check(buildmeta) { def results = [ 'good': true, @@ -23,7 +24,7 @@ def check(buildmeta) { productcomponents[key][buildstampnumber] += 1 } } - echo productcomponents.toString() + echo prettyPrint(toJson(productcomponents)) for (pc in productcomponents.keySet()) { bsns = productcomponents[pc] if (bsns.size() > 1) { From 0f9d832f5c93ab50b73a32beda61a1e877b353ff Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sat, 6 Nov 2021 16:31:50 +0000 Subject: [PATCH 030/153] Add a new meta walker and test it --- build/integrity.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/integrity.groovy b/build/integrity.groovy index fa7594f..73d5d46 100644 --- a/build/integrity.groovy +++ b/build/integrity.groovy @@ -31,7 +31,7 @@ def check(buildmeta) { results.good = false results.comment += "There is more than one version of Product component: ${pc} being used in this build:\n" for (bsn in bsns.keySet()) { - comment += "${bsn}\n" + results.comment += "${bsn}\n" } } } From fe46dfeee60b3c95c6e2adf24d22ca4031fcff36 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sat, 6 Nov 2021 17:16:29 +0000 Subject: [PATCH 031/153] Add a new meta walker and test it --- autobuilder.groovy | 2 +- meta/folder.groovy | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/autobuilder.groovy b/autobuilder.groovy index 1a071e5..667f89a 100644 --- a/autobuilder.groovy +++ b/autobuilder.groovy @@ -78,7 +78,7 @@ def setupmeta(script, String productname, String subcomponentname, String produc now.format("yyMMdd.HHmm", TimeZone.getTimeZone('UTC')) meta.jenkinsbuildinfo.set(JOB_NAME, BUILD_ID.toInteger(), NODE_NAME, now.toString()) for (p in params) { - meta.jenkinsbuildinfo.addParameter(p.key, p.value.toString()) + meta.jenkinsbuildinfo.addParameter(p.key, p.value) } return meta } diff --git a/meta/folder.groovy b/meta/folder.groovy index 9672294..46622cb 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -148,25 +148,29 @@ class JenkinsBuildParameter extends GISJsonSerialised { private String name private String value - JenkinsBuildParameter(script, String name = '', String value = '') { + JenkinsBuildParameter(script, String name = '', String valuetype = '', String value = '') { super(script) this.name = name + this.valuetype = valuetype this.value = value } - void set(String name, String value) { + void set(String name, String valuetype, String value) { this.name = name + this.valuetype = valuetype this.value = value } void deserialiseJson(rawmeta) { name = rawmeta['name'] + valuetype = rawmeta['valuetype'] value = rawmeta['value'] } LinkedHashMap serialisationdata() { def data = [ 'name' : name, + 'valuetype' : valuetype, 'value' : value, ] return data @@ -207,8 +211,8 @@ class JenkinsBuildInfo extends GISJsonSerialised { return isfullbuild } - void addParameter(String name, String value) { - def p = new JenkinsBuildParameter(script, name, value) + void addParameter(String name, value) { + def p = new JenkinsBuildParameter(script, name, value.getClass(), value.toString()) parameters.add(p) return p } From b9b69d2b8f65c071b190a6cdf75eb7b9cbb606c7 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sat, 6 Nov 2021 17:22:58 +0000 Subject: [PATCH 032/153] Add a new meta walker and test it --- meta/folder.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta/folder.groovy b/meta/folder.groovy index 46622cb..b59e284 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -212,7 +212,7 @@ class JenkinsBuildInfo extends GISJsonSerialised { } void addParameter(String name, value) { - def p = new JenkinsBuildParameter(script, name, value.getClass(), value.toString()) + def p = new JenkinsBuildParameter(script, name, value.getClass().toString(), value.toString()) parameters.add(p) return p } From 00857de6c601e5600da200fc161ea9b9073e7329 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sat, 6 Nov 2021 17:24:35 +0000 Subject: [PATCH 033/153] Add a new meta walker and test it --- meta/folder.groovy | 1 + 1 file changed, 1 insertion(+) diff --git a/meta/folder.groovy b/meta/folder.groovy index b59e284..ae772c5 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -146,6 +146,7 @@ class GitInfo extends GISJsonSerialised { class JenkinsBuildParameter extends GISJsonSerialised { private String name + private String valuetype private String value JenkinsBuildParameter(script, String name = '', String valuetype = '', String value = '') { From 0c80b055fa60b072cd192fc392eb297781a850e9 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sat, 6 Nov 2021 20:36:54 +0000 Subject: [PATCH 034/153] Do build integrity check and post build actions --- check/build_meta.groovy | 2 +- copy/all.groovy | 2 +- copy/esw.groovy | 2 +- copy/logic.groovy | 2 +- differences/metahierarchy.groovy | 2 +- documentation/doxygen_deploy.groovy | 2 +- publish/package.groovy | 2 +- publish/promptingpublish.groovy | 2 +- publish/publish.groovy | 2 +- release/release.groovy | 2 +- staticanalysis/ccm.groovy | 2 +- staticanalysis/cppcheck.groovy | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) diff --git a/check/build_meta.groovy b/check/build_meta.groovy index 34eed98..6e669bc 100644 --- a/check/build_meta.groovy +++ b/check/build_meta.groovy @@ -1,5 +1,5 @@ pipeline { - agent { label "${AGENT_LABEL}" } + agent { label AGENT_LABEL } stages { stage('Initial setup') { steps { diff --git a/copy/all.groovy b/copy/all.groovy index b7c4607..6d09903 100644 --- a/copy/all.groovy +++ b/copy/all.groovy @@ -1,5 +1,5 @@ pipeline { - agent { label "${AGENT_LABEL}" } + agent { label AGENT_LABEL } stages { stage('Initial setup') { steps { diff --git a/copy/esw.groovy b/copy/esw.groovy index 2a63171..0a5a804 100644 --- a/copy/esw.groovy +++ b/copy/esw.groovy @@ -1,5 +1,5 @@ pipeline { - agent { label "${AGENT_LABEL}" } + agent { label AGENT_LABEL } stages { stage('Initial setup') { steps { diff --git a/copy/logic.groovy b/copy/logic.groovy index 43ebd9c..8092220 100644 --- a/copy/logic.groovy +++ b/copy/logic.groovy @@ -1,5 +1,5 @@ pipeline { - agent { label "${AGENT_LABEL}" } + agent { label AGENT_LABEL } stages { stage('Initial setup') { steps { diff --git a/differences/metahierarchy.groovy b/differences/metahierarchy.groovy index 4bcdcdc..10b24a0 100644 --- a/differences/metahierarchy.groovy +++ b/differences/metahierarchy.groovy @@ -1,5 +1,5 @@ pipeline { - agent { label "${AGENT_LABEL}" } + agent { label AGENT_LABEL } stages { stage('Initial setup') { steps { diff --git a/documentation/doxygen_deploy.groovy b/documentation/doxygen_deploy.groovy index 6642256..5054c02 100644 --- a/documentation/doxygen_deploy.groovy +++ b/documentation/doxygen_deploy.groovy @@ -1,5 +1,5 @@ pipeline { - agent { label "${AGENT_LABEL}" } + agent { label AGENT_LABEL } stages { stage('Initial setup') { steps { diff --git a/publish/package.groovy b/publish/package.groovy index 3bd9565..958a614 100644 --- a/publish/package.groovy +++ b/publish/package.groovy @@ -1,5 +1,5 @@ pipeline { - agent { label "${AGENT_LABEL}" } + agent { label AGENT_LABEL } stages { stage('Initial setup') { steps { diff --git a/publish/promptingpublish.groovy b/publish/promptingpublish.groovy index 21de708..9d51915 100644 --- a/publish/promptingpublish.groovy +++ b/publish/promptingpublish.groovy @@ -1,5 +1,5 @@ pipeline { - agent { label "${AGENT_LABEL}" } + agent { label AGENT_LABEL } stages { stage('Initial setup') { steps { diff --git a/publish/publish.groovy b/publish/publish.groovy index 7beb134..82a32ad 100644 --- a/publish/publish.groovy +++ b/publish/publish.groovy @@ -1,5 +1,5 @@ pipeline { - agent { label "${AGENT_LABEL}" } + agent { label AGENT_LABEL } stages { stage('Initial setup') { steps { diff --git a/release/release.groovy b/release/release.groovy index 4220f3b..351985d 100644 --- a/release/release.groovy +++ b/release/release.groovy @@ -1,5 +1,5 @@ pipeline { - agent { label "${AGENT_LABEL}" } + agent { label AGENT_LABEL } stages { stage('Initial setup') { steps { diff --git a/staticanalysis/ccm.groovy b/staticanalysis/ccm.groovy index f0e5b80..f3213d9 100644 --- a/staticanalysis/ccm.groovy +++ b/staticanalysis/ccm.groovy @@ -1,5 +1,5 @@ pipeline { - agent { label "${AGENT_LABEL}" } + agent { label AGENT_LABEL } stages { stage('Initial setup') { steps { diff --git a/staticanalysis/cppcheck.groovy b/staticanalysis/cppcheck.groovy index bdc6a2a..5ffa681 100644 --- a/staticanalysis/cppcheck.groovy +++ b/staticanalysis/cppcheck.groovy @@ -1,5 +1,5 @@ pipeline { - agent { label "${AGENT_LABEL}" } + agent { label AGENT_LABEL } stages { stage('Initial setup') { steps { From 52987df69618da7ba697641392fbb1ae8fcd7281 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sat, 6 Nov 2021 20:49:19 +0000 Subject: [PATCH 035/153] Remove redundant escapes --- copy/esw.groovy | 2 +- copy/filtered.groovy | 2 +- copy/logic.groovy | 2 +- staticanalysis/ccm.groovy | 2 +- staticanalysis/cpd.groovy | 2 +- staticanalysis/cppcheck.groovy | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/copy/esw.groovy b/copy/esw.groovy index 0a5a804..c6c0147 100644 --- a/copy/esw.groovy +++ b/copy/esw.groovy @@ -41,7 +41,7 @@ pipeline { rm -v -rf meta mv -v "${ESW}"/* . """ - archiveArtifacts "${artifactlist}" + archiveArtifacts artifactlist } } } diff --git a/copy/filtered.groovy b/copy/filtered.groovy index feaa2ab..7fd87b6 100644 --- a/copy/filtered.groovy +++ b/copy/filtered.groovy @@ -48,7 +48,7 @@ pipeline { steps { script { def artifactlist = meta.generateartifacts(["filtered/**"]) - archiveArtifacts "${artifactlist}" + archiveArtifacts artifactlist } } } diff --git a/copy/logic.groovy b/copy/logic.groovy index 8092220..9585f01 100644 --- a/copy/logic.groovy +++ b/copy/logic.groovy @@ -43,7 +43,7 @@ pipeline { rm -v -rf diff mv -v "logic"/* . """ - archiveArtifacts "${artifactlist}" + archiveArtifacts artifactlist } } } diff --git a/staticanalysis/ccm.groovy b/staticanalysis/ccm.groovy index f3213d9..5a7c6f5 100644 --- a/staticanalysis/ccm.groovy +++ b/staticanalysis/ccm.groovy @@ -97,7 +97,7 @@ pipeline { script { ArrayList itemsForRelease = ["${STATICANALYSIS}/**"] def artifactlist = meta.generateartifacts(itemsForRelease) - archiveArtifacts "${artifactlist}" + archiveArtifacts artifactlist } } } diff --git a/staticanalysis/cpd.groovy b/staticanalysis/cpd.groovy index 6f3a33f..5a77cab 100644 --- a/staticanalysis/cpd.groovy +++ b/staticanalysis/cpd.groovy @@ -129,7 +129,7 @@ pipeline { script { ArrayList itemsForRelease = ["${STATICANALYSIS}/**"] def artifactlist = meta.generateartifacts(itemsForRelease) - archiveArtifacts "${artifactlist}" + archiveArtifacts artifactlist } } } diff --git a/staticanalysis/cppcheck.groovy b/staticanalysis/cppcheck.groovy index 5ffa681..9455b0b 100644 --- a/staticanalysis/cppcheck.groovy +++ b/staticanalysis/cppcheck.groovy @@ -91,7 +91,7 @@ pipeline { script { ArrayList itemsForRelease = ["${STATICANALYSIS}/**"] def artifactlist = meta.generateartifacts(itemsForRelease) - archiveArtifacts "${artifactlist}" + archiveArtifacts artifactlist } } } From 10a79af9cea9ff860495b1b87851bb18b346cf7e Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sat, 6 Nov 2021 20:52:03 +0000 Subject: [PATCH 036/153] Remove redundant escapes --- copy/esw.groovy | 2 +- copy/filtered.groovy | 2 +- copy/logic.groovy | 2 +- staticanalysis/ccm.groovy | 2 +- staticanalysis/cpd.groovy | 2 +- staticanalysis/cppcheck.groovy | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/copy/esw.groovy b/copy/esw.groovy index 2a63171..f53e0fe 100644 --- a/copy/esw.groovy +++ b/copy/esw.groovy @@ -41,7 +41,7 @@ pipeline { rm -v -rf meta mv -v "${ESW}"/* . """ - archiveArtifacts "${artifactlist}" + archiveArtifacts artifactlist } } } diff --git a/copy/filtered.groovy b/copy/filtered.groovy index feaa2ab..7fd87b6 100644 --- a/copy/filtered.groovy +++ b/copy/filtered.groovy @@ -48,7 +48,7 @@ pipeline { steps { script { def artifactlist = meta.generateartifacts(["filtered/**"]) - archiveArtifacts "${artifactlist}" + archiveArtifacts artifactlist } } } diff --git a/copy/logic.groovy b/copy/logic.groovy index 43ebd9c..b880046 100644 --- a/copy/logic.groovy +++ b/copy/logic.groovy @@ -43,7 +43,7 @@ pipeline { rm -v -rf diff mv -v "logic"/* . """ - archiveArtifacts "${artifactlist}" + archiveArtifacts artifactlist } } } diff --git a/staticanalysis/ccm.groovy b/staticanalysis/ccm.groovy index f0e5b80..68afa48 100644 --- a/staticanalysis/ccm.groovy +++ b/staticanalysis/ccm.groovy @@ -97,7 +97,7 @@ pipeline { script { ArrayList itemsForRelease = ["${STATICANALYSIS}/**"] def artifactlist = meta.generateartifacts(itemsForRelease) - archiveArtifacts "${artifactlist}" + archiveArtifacts artifactlist } } } diff --git a/staticanalysis/cpd.groovy b/staticanalysis/cpd.groovy index 6f3a33f..5a77cab 100644 --- a/staticanalysis/cpd.groovy +++ b/staticanalysis/cpd.groovy @@ -129,7 +129,7 @@ pipeline { script { ArrayList itemsForRelease = ["${STATICANALYSIS}/**"] def artifactlist = meta.generateartifacts(itemsForRelease) - archiveArtifacts "${artifactlist}" + archiveArtifacts artifactlist } } } diff --git a/staticanalysis/cppcheck.groovy b/staticanalysis/cppcheck.groovy index bdc6a2a..46744f7 100644 --- a/staticanalysis/cppcheck.groovy +++ b/staticanalysis/cppcheck.groovy @@ -91,7 +91,7 @@ pipeline { script { ArrayList itemsForRelease = ["${STATICANALYSIS}/**"] def artifactlist = meta.generateartifacts(itemsForRelease) - archiveArtifacts "${artifactlist}" + archiveArtifacts artifactlist } } } From 11757204e472ff49591914c44a71ade50d8f33a5 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sat, 6 Nov 2021 20:52:53 +0000 Subject: [PATCH 037/153] Remove redundant escapes --- check/build_meta.groovy | 2 +- copy/all.groovy | 2 +- copy/esw.groovy | 2 +- copy/logic.groovy | 2 +- differences/metahierarchy.groovy | 2 +- documentation/doxygen_deploy.groovy | 2 +- publish/package.groovy | 2 +- publish/promptingpublish.groovy | 2 +- publish/publish.groovy | 2 +- release/release.groovy | 2 +- staticanalysis/ccm.groovy | 2 +- staticanalysis/cppcheck.groovy | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) diff --git a/check/build_meta.groovy b/check/build_meta.groovy index 34eed98..6e669bc 100644 --- a/check/build_meta.groovy +++ b/check/build_meta.groovy @@ -1,5 +1,5 @@ pipeline { - agent { label "${AGENT_LABEL}" } + agent { label AGENT_LABEL } stages { stage('Initial setup') { steps { diff --git a/copy/all.groovy b/copy/all.groovy index b7c4607..6d09903 100644 --- a/copy/all.groovy +++ b/copy/all.groovy @@ -1,5 +1,5 @@ pipeline { - agent { label "${AGENT_LABEL}" } + agent { label AGENT_LABEL } stages { stage('Initial setup') { steps { diff --git a/copy/esw.groovy b/copy/esw.groovy index f53e0fe..c6c0147 100644 --- a/copy/esw.groovy +++ b/copy/esw.groovy @@ -1,5 +1,5 @@ pipeline { - agent { label "${AGENT_LABEL}" } + agent { label AGENT_LABEL } stages { stage('Initial setup') { steps { diff --git a/copy/logic.groovy b/copy/logic.groovy index b880046..9585f01 100644 --- a/copy/logic.groovy +++ b/copy/logic.groovy @@ -1,5 +1,5 @@ pipeline { - agent { label "${AGENT_LABEL}" } + agent { label AGENT_LABEL } stages { stage('Initial setup') { steps { diff --git a/differences/metahierarchy.groovy b/differences/metahierarchy.groovy index 4bcdcdc..10b24a0 100644 --- a/differences/metahierarchy.groovy +++ b/differences/metahierarchy.groovy @@ -1,5 +1,5 @@ pipeline { - agent { label "${AGENT_LABEL}" } + agent { label AGENT_LABEL } stages { stage('Initial setup') { steps { diff --git a/documentation/doxygen_deploy.groovy b/documentation/doxygen_deploy.groovy index 6642256..5054c02 100644 --- a/documentation/doxygen_deploy.groovy +++ b/documentation/doxygen_deploy.groovy @@ -1,5 +1,5 @@ pipeline { - agent { label "${AGENT_LABEL}" } + agent { label AGENT_LABEL } stages { stage('Initial setup') { steps { diff --git a/publish/package.groovy b/publish/package.groovy index 3bd9565..958a614 100644 --- a/publish/package.groovy +++ b/publish/package.groovy @@ -1,5 +1,5 @@ pipeline { - agent { label "${AGENT_LABEL}" } + agent { label AGENT_LABEL } stages { stage('Initial setup') { steps { diff --git a/publish/promptingpublish.groovy b/publish/promptingpublish.groovy index 21de708..9d51915 100644 --- a/publish/promptingpublish.groovy +++ b/publish/promptingpublish.groovy @@ -1,5 +1,5 @@ pipeline { - agent { label "${AGENT_LABEL}" } + agent { label AGENT_LABEL } stages { stage('Initial setup') { steps { diff --git a/publish/publish.groovy b/publish/publish.groovy index 7beb134..82a32ad 100644 --- a/publish/publish.groovy +++ b/publish/publish.groovy @@ -1,5 +1,5 @@ pipeline { - agent { label "${AGENT_LABEL}" } + agent { label AGENT_LABEL } stages { stage('Initial setup') { steps { diff --git a/release/release.groovy b/release/release.groovy index 4220f3b..351985d 100644 --- a/release/release.groovy +++ b/release/release.groovy @@ -1,5 +1,5 @@ pipeline { - agent { label "${AGENT_LABEL}" } + agent { label AGENT_LABEL } stages { stage('Initial setup') { steps { diff --git a/staticanalysis/ccm.groovy b/staticanalysis/ccm.groovy index 68afa48..5a7c6f5 100644 --- a/staticanalysis/ccm.groovy +++ b/staticanalysis/ccm.groovy @@ -1,5 +1,5 @@ pipeline { - agent { label "${AGENT_LABEL}" } + agent { label AGENT_LABEL } stages { stage('Initial setup') { steps { diff --git a/staticanalysis/cppcheck.groovy b/staticanalysis/cppcheck.groovy index 46744f7..9455b0b 100644 --- a/staticanalysis/cppcheck.groovy +++ b/staticanalysis/cppcheck.groovy @@ -1,5 +1,5 @@ pipeline { - agent { label "${AGENT_LABEL}" } + agent { label AGENT_LABEL } stages { stage('Initial setup') { steps { From 36c56b19de9a5fa441bf2c2d565b99c9494ab2af Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sat, 6 Nov 2021 20:54:31 +0000 Subject: [PATCH 038/153] Remove redundant escapes --- check/build_meta.groovy | 2 +- copy/all.groovy | 2 +- copy/esw.groovy | 2 +- copy/logic.groovy | 2 +- differences/metahierarchy.groovy | 2 +- documentation/doxygen_deploy.groovy | 2 +- publish/package.groovy | 2 +- publish/promptingpublish.groovy | 2 +- publish/publish.groovy | 2 +- release/release.groovy | 2 +- staticanalysis/ccm.groovy | 2 +- staticanalysis/cppcheck.groovy | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) diff --git a/check/build_meta.groovy b/check/build_meta.groovy index 34eed98..6e669bc 100644 --- a/check/build_meta.groovy +++ b/check/build_meta.groovy @@ -1,5 +1,5 @@ pipeline { - agent { label "${AGENT_LABEL}" } + agent { label AGENT_LABEL } stages { stage('Initial setup') { steps { diff --git a/copy/all.groovy b/copy/all.groovy index b7c4607..6d09903 100644 --- a/copy/all.groovy +++ b/copy/all.groovy @@ -1,5 +1,5 @@ pipeline { - agent { label "${AGENT_LABEL}" } + agent { label AGENT_LABEL } stages { stage('Initial setup') { steps { diff --git a/copy/esw.groovy b/copy/esw.groovy index 2a63171..0a5a804 100644 --- a/copy/esw.groovy +++ b/copy/esw.groovy @@ -1,5 +1,5 @@ pipeline { - agent { label "${AGENT_LABEL}" } + agent { label AGENT_LABEL } stages { stage('Initial setup') { steps { diff --git a/copy/logic.groovy b/copy/logic.groovy index 43ebd9c..8092220 100644 --- a/copy/logic.groovy +++ b/copy/logic.groovy @@ -1,5 +1,5 @@ pipeline { - agent { label "${AGENT_LABEL}" } + agent { label AGENT_LABEL } stages { stage('Initial setup') { steps { diff --git a/differences/metahierarchy.groovy b/differences/metahierarchy.groovy index 4bcdcdc..10b24a0 100644 --- a/differences/metahierarchy.groovy +++ b/differences/metahierarchy.groovy @@ -1,5 +1,5 @@ pipeline { - agent { label "${AGENT_LABEL}" } + agent { label AGENT_LABEL } stages { stage('Initial setup') { steps { diff --git a/documentation/doxygen_deploy.groovy b/documentation/doxygen_deploy.groovy index 6642256..5054c02 100644 --- a/documentation/doxygen_deploy.groovy +++ b/documentation/doxygen_deploy.groovy @@ -1,5 +1,5 @@ pipeline { - agent { label "${AGENT_LABEL}" } + agent { label AGENT_LABEL } stages { stage('Initial setup') { steps { diff --git a/publish/package.groovy b/publish/package.groovy index 3bd9565..958a614 100644 --- a/publish/package.groovy +++ b/publish/package.groovy @@ -1,5 +1,5 @@ pipeline { - agent { label "${AGENT_LABEL}" } + agent { label AGENT_LABEL } stages { stage('Initial setup') { steps { diff --git a/publish/promptingpublish.groovy b/publish/promptingpublish.groovy index 21de708..9d51915 100644 --- a/publish/promptingpublish.groovy +++ b/publish/promptingpublish.groovy @@ -1,5 +1,5 @@ pipeline { - agent { label "${AGENT_LABEL}" } + agent { label AGENT_LABEL } stages { stage('Initial setup') { steps { diff --git a/publish/publish.groovy b/publish/publish.groovy index 7beb134..82a32ad 100644 --- a/publish/publish.groovy +++ b/publish/publish.groovy @@ -1,5 +1,5 @@ pipeline { - agent { label "${AGENT_LABEL}" } + agent { label AGENT_LABEL } stages { stage('Initial setup') { steps { diff --git a/release/release.groovy b/release/release.groovy index 4220f3b..351985d 100644 --- a/release/release.groovy +++ b/release/release.groovy @@ -1,5 +1,5 @@ pipeline { - agent { label "${AGENT_LABEL}" } + agent { label AGENT_LABEL } stages { stage('Initial setup') { steps { diff --git a/staticanalysis/ccm.groovy b/staticanalysis/ccm.groovy index f0e5b80..f3213d9 100644 --- a/staticanalysis/ccm.groovy +++ b/staticanalysis/ccm.groovy @@ -1,5 +1,5 @@ pipeline { - agent { label "${AGENT_LABEL}" } + agent { label AGENT_LABEL } stages { stage('Initial setup') { steps { diff --git a/staticanalysis/cppcheck.groovy b/staticanalysis/cppcheck.groovy index bdc6a2a..5ffa681 100644 --- a/staticanalysis/cppcheck.groovy +++ b/staticanalysis/cppcheck.groovy @@ -1,5 +1,5 @@ pipeline { - agent { label "${AGENT_LABEL}" } + agent { label AGENT_LABEL } stages { stage('Initial setup') { steps { From 8e99ad23001937e409e9fbcce189f5ca713230d5 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sat, 6 Nov 2021 20:54:55 +0000 Subject: [PATCH 039/153] Remove redundant escapes --- copy/esw.groovy | 2 +- copy/filtered.groovy | 2 +- copy/logic.groovy | 2 +- staticanalysis/ccm.groovy | 2 +- staticanalysis/cpd.groovy | 2 +- staticanalysis/cppcheck.groovy | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/copy/esw.groovy b/copy/esw.groovy index 0a5a804..c6c0147 100644 --- a/copy/esw.groovy +++ b/copy/esw.groovy @@ -41,7 +41,7 @@ pipeline { rm -v -rf meta mv -v "${ESW}"/* . """ - archiveArtifacts "${artifactlist}" + archiveArtifacts artifactlist } } } diff --git a/copy/filtered.groovy b/copy/filtered.groovy index feaa2ab..7fd87b6 100644 --- a/copy/filtered.groovy +++ b/copy/filtered.groovy @@ -48,7 +48,7 @@ pipeline { steps { script { def artifactlist = meta.generateartifacts(["filtered/**"]) - archiveArtifacts "${artifactlist}" + archiveArtifacts artifactlist } } } diff --git a/copy/logic.groovy b/copy/logic.groovy index 8092220..9585f01 100644 --- a/copy/logic.groovy +++ b/copy/logic.groovy @@ -43,7 +43,7 @@ pipeline { rm -v -rf diff mv -v "logic"/* . """ - archiveArtifacts "${artifactlist}" + archiveArtifacts artifactlist } } } diff --git a/staticanalysis/ccm.groovy b/staticanalysis/ccm.groovy index f3213d9..5a7c6f5 100644 --- a/staticanalysis/ccm.groovy +++ b/staticanalysis/ccm.groovy @@ -97,7 +97,7 @@ pipeline { script { ArrayList itemsForRelease = ["${STATICANALYSIS}/**"] def artifactlist = meta.generateartifacts(itemsForRelease) - archiveArtifacts "${artifactlist}" + archiveArtifacts artifactlist } } } diff --git a/staticanalysis/cpd.groovy b/staticanalysis/cpd.groovy index 6f3a33f..5a77cab 100644 --- a/staticanalysis/cpd.groovy +++ b/staticanalysis/cpd.groovy @@ -129,7 +129,7 @@ pipeline { script { ArrayList itemsForRelease = ["${STATICANALYSIS}/**"] def artifactlist = meta.generateartifacts(itemsForRelease) - archiveArtifacts "${artifactlist}" + archiveArtifacts artifactlist } } } diff --git a/staticanalysis/cppcheck.groovy b/staticanalysis/cppcheck.groovy index 5ffa681..9455b0b 100644 --- a/staticanalysis/cppcheck.groovy +++ b/staticanalysis/cppcheck.groovy @@ -91,7 +91,7 @@ pipeline { script { ArrayList itemsForRelease = ["${STATICANALYSIS}/**"] def artifactlist = meta.generateartifacts(itemsForRelease) - archiveArtifacts "${artifactlist}" + archiveArtifacts artifactlist } } } From 3b0b793fcb9751e6894aec15d9673682341276f6 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sat, 6 Nov 2021 20:55:54 +0000 Subject: [PATCH 040/153] Remove redundant escapes --- copy/esw.groovy | 2 +- copy/filtered.groovy | 2 +- copy/logic.groovy | 2 +- staticanalysis/ccm.groovy | 2 +- staticanalysis/cpd.groovy | 2 +- staticanalysis/cppcheck.groovy | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/copy/esw.groovy b/copy/esw.groovy index 2a63171..f53e0fe 100644 --- a/copy/esw.groovy +++ b/copy/esw.groovy @@ -41,7 +41,7 @@ pipeline { rm -v -rf meta mv -v "${ESW}"/* . """ - archiveArtifacts "${artifactlist}" + archiveArtifacts artifactlist } } } diff --git a/copy/filtered.groovy b/copy/filtered.groovy index feaa2ab..7fd87b6 100644 --- a/copy/filtered.groovy +++ b/copy/filtered.groovy @@ -48,7 +48,7 @@ pipeline { steps { script { def artifactlist = meta.generateartifacts(["filtered/**"]) - archiveArtifacts "${artifactlist}" + archiveArtifacts artifactlist } } } diff --git a/copy/logic.groovy b/copy/logic.groovy index 43ebd9c..b880046 100644 --- a/copy/logic.groovy +++ b/copy/logic.groovy @@ -43,7 +43,7 @@ pipeline { rm -v -rf diff mv -v "logic"/* . """ - archiveArtifacts "${artifactlist}" + archiveArtifacts artifactlist } } } diff --git a/staticanalysis/ccm.groovy b/staticanalysis/ccm.groovy index f0e5b80..68afa48 100644 --- a/staticanalysis/ccm.groovy +++ b/staticanalysis/ccm.groovy @@ -97,7 +97,7 @@ pipeline { script { ArrayList itemsForRelease = ["${STATICANALYSIS}/**"] def artifactlist = meta.generateartifacts(itemsForRelease) - archiveArtifacts "${artifactlist}" + archiveArtifacts artifactlist } } } diff --git a/staticanalysis/cpd.groovy b/staticanalysis/cpd.groovy index 6f3a33f..5a77cab 100644 --- a/staticanalysis/cpd.groovy +++ b/staticanalysis/cpd.groovy @@ -129,7 +129,7 @@ pipeline { script { ArrayList itemsForRelease = ["${STATICANALYSIS}/**"] def artifactlist = meta.generateartifacts(itemsForRelease) - archiveArtifacts "${artifactlist}" + archiveArtifacts artifactlist } } } diff --git a/staticanalysis/cppcheck.groovy b/staticanalysis/cppcheck.groovy index bdc6a2a..46744f7 100644 --- a/staticanalysis/cppcheck.groovy +++ b/staticanalysis/cppcheck.groovy @@ -91,7 +91,7 @@ pipeline { script { ArrayList itemsForRelease = ["${STATICANALYSIS}/**"] def artifactlist = meta.generateartifacts(itemsForRelease) - archiveArtifacts "${artifactlist}" + archiveArtifacts artifactlist } } } From 9b99cb14b21688b49b7b7d8885c1a583d2999fb9 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sat, 6 Nov 2021 20:56:05 +0000 Subject: [PATCH 041/153] Remove redundant escapes --- check/build_meta.groovy | 2 +- copy/all.groovy | 2 +- copy/esw.groovy | 2 +- copy/logic.groovy | 2 +- differences/metahierarchy.groovy | 2 +- documentation/doxygen_deploy.groovy | 2 +- publish/package.groovy | 2 +- publish/promptingpublish.groovy | 2 +- publish/publish.groovy | 2 +- release/release.groovy | 2 +- staticanalysis/ccm.groovy | 2 +- staticanalysis/cppcheck.groovy | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) diff --git a/check/build_meta.groovy b/check/build_meta.groovy index 34eed98..6e669bc 100644 --- a/check/build_meta.groovy +++ b/check/build_meta.groovy @@ -1,5 +1,5 @@ pipeline { - agent { label "${AGENT_LABEL}" } + agent { label AGENT_LABEL } stages { stage('Initial setup') { steps { diff --git a/copy/all.groovy b/copy/all.groovy index b7c4607..6d09903 100644 --- a/copy/all.groovy +++ b/copy/all.groovy @@ -1,5 +1,5 @@ pipeline { - agent { label "${AGENT_LABEL}" } + agent { label AGENT_LABEL } stages { stage('Initial setup') { steps { diff --git a/copy/esw.groovy b/copy/esw.groovy index f53e0fe..c6c0147 100644 --- a/copy/esw.groovy +++ b/copy/esw.groovy @@ -1,5 +1,5 @@ pipeline { - agent { label "${AGENT_LABEL}" } + agent { label AGENT_LABEL } stages { stage('Initial setup') { steps { diff --git a/copy/logic.groovy b/copy/logic.groovy index b880046..9585f01 100644 --- a/copy/logic.groovy +++ b/copy/logic.groovy @@ -1,5 +1,5 @@ pipeline { - agent { label "${AGENT_LABEL}" } + agent { label AGENT_LABEL } stages { stage('Initial setup') { steps { diff --git a/differences/metahierarchy.groovy b/differences/metahierarchy.groovy index 4bcdcdc..10b24a0 100644 --- a/differences/metahierarchy.groovy +++ b/differences/metahierarchy.groovy @@ -1,5 +1,5 @@ pipeline { - agent { label "${AGENT_LABEL}" } + agent { label AGENT_LABEL } stages { stage('Initial setup') { steps { diff --git a/documentation/doxygen_deploy.groovy b/documentation/doxygen_deploy.groovy index 6642256..5054c02 100644 --- a/documentation/doxygen_deploy.groovy +++ b/documentation/doxygen_deploy.groovy @@ -1,5 +1,5 @@ pipeline { - agent { label "${AGENT_LABEL}" } + agent { label AGENT_LABEL } stages { stage('Initial setup') { steps { diff --git a/publish/package.groovy b/publish/package.groovy index 3bd9565..958a614 100644 --- a/publish/package.groovy +++ b/publish/package.groovy @@ -1,5 +1,5 @@ pipeline { - agent { label "${AGENT_LABEL}" } + agent { label AGENT_LABEL } stages { stage('Initial setup') { steps { diff --git a/publish/promptingpublish.groovy b/publish/promptingpublish.groovy index 21de708..9d51915 100644 --- a/publish/promptingpublish.groovy +++ b/publish/promptingpublish.groovy @@ -1,5 +1,5 @@ pipeline { - agent { label "${AGENT_LABEL}" } + agent { label AGENT_LABEL } stages { stage('Initial setup') { steps { diff --git a/publish/publish.groovy b/publish/publish.groovy index 7beb134..82a32ad 100644 --- a/publish/publish.groovy +++ b/publish/publish.groovy @@ -1,5 +1,5 @@ pipeline { - agent { label "${AGENT_LABEL}" } + agent { label AGENT_LABEL } stages { stage('Initial setup') { steps { diff --git a/release/release.groovy b/release/release.groovy index 4220f3b..351985d 100644 --- a/release/release.groovy +++ b/release/release.groovy @@ -1,5 +1,5 @@ pipeline { - agent { label "${AGENT_LABEL}" } + agent { label AGENT_LABEL } stages { stage('Initial setup') { steps { diff --git a/staticanalysis/ccm.groovy b/staticanalysis/ccm.groovy index 68afa48..5a7c6f5 100644 --- a/staticanalysis/ccm.groovy +++ b/staticanalysis/ccm.groovy @@ -1,5 +1,5 @@ pipeline { - agent { label "${AGENT_LABEL}" } + agent { label AGENT_LABEL } stages { stage('Initial setup') { steps { diff --git a/staticanalysis/cppcheck.groovy b/staticanalysis/cppcheck.groovy index 46744f7..9455b0b 100644 --- a/staticanalysis/cppcheck.groovy +++ b/staticanalysis/cppcheck.groovy @@ -1,5 +1,5 @@ pipeline { - agent { label "${AGENT_LABEL}" } + agent { label AGENT_LABEL } stages { stage('Initial setup') { steps { From 118a2e283a4c4883868c432354512246b72585a3 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sat, 6 Nov 2021 21:00:21 +0000 Subject: [PATCH 042/153] Remove redundant escapes --- copy/esw.groovy | 2 +- copy/filtered.groovy | 2 +- copy/logic.groovy | 2 +- staticanalysis/ccm.groovy | 2 +- staticanalysis/cpd.groovy | 2 +- staticanalysis/cppcheck.groovy | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/copy/esw.groovy b/copy/esw.groovy index 2a63171..f53e0fe 100644 --- a/copy/esw.groovy +++ b/copy/esw.groovy @@ -41,7 +41,7 @@ pipeline { rm -v -rf meta mv -v "${ESW}"/* . """ - archiveArtifacts "${artifactlist}" + archiveArtifacts artifactlist } } } diff --git a/copy/filtered.groovy b/copy/filtered.groovy index feaa2ab..7fd87b6 100644 --- a/copy/filtered.groovy +++ b/copy/filtered.groovy @@ -48,7 +48,7 @@ pipeline { steps { script { def artifactlist = meta.generateartifacts(["filtered/**"]) - archiveArtifacts "${artifactlist}" + archiveArtifacts artifactlist } } } diff --git a/copy/logic.groovy b/copy/logic.groovy index 43ebd9c..b880046 100644 --- a/copy/logic.groovy +++ b/copy/logic.groovy @@ -43,7 +43,7 @@ pipeline { rm -v -rf diff mv -v "logic"/* . """ - archiveArtifacts "${artifactlist}" + archiveArtifacts artifactlist } } } diff --git a/staticanalysis/ccm.groovy b/staticanalysis/ccm.groovy index f0e5b80..68afa48 100644 --- a/staticanalysis/ccm.groovy +++ b/staticanalysis/ccm.groovy @@ -97,7 +97,7 @@ pipeline { script { ArrayList itemsForRelease = ["${STATICANALYSIS}/**"] def artifactlist = meta.generateartifacts(itemsForRelease) - archiveArtifacts "${artifactlist}" + archiveArtifacts artifactlist } } } diff --git a/staticanalysis/cpd.groovy b/staticanalysis/cpd.groovy index 6f3a33f..5a77cab 100644 --- a/staticanalysis/cpd.groovy +++ b/staticanalysis/cpd.groovy @@ -129,7 +129,7 @@ pipeline { script { ArrayList itemsForRelease = ["${STATICANALYSIS}/**"] def artifactlist = meta.generateartifacts(itemsForRelease) - archiveArtifacts "${artifactlist}" + archiveArtifacts artifactlist } } } diff --git a/staticanalysis/cppcheck.groovy b/staticanalysis/cppcheck.groovy index bdc6a2a..46744f7 100644 --- a/staticanalysis/cppcheck.groovy +++ b/staticanalysis/cppcheck.groovy @@ -91,7 +91,7 @@ pipeline { script { ArrayList itemsForRelease = ["${STATICANALYSIS}/**"] def artifactlist = meta.generateartifacts(itemsForRelease) - archiveArtifacts "${artifactlist}" + archiveArtifacts artifactlist } } } From 58a0ba8ed512048fe8c01cd544cbb8d826185eb8 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sat, 6 Nov 2021 21:00:43 +0000 Subject: [PATCH 043/153] Remove redundant escapes --- check/build_meta.groovy | 2 +- copy/all.groovy | 2 +- copy/esw.groovy | 2 +- copy/logic.groovy | 2 +- differences/metahierarchy.groovy | 2 +- documentation/doxygen_deploy.groovy | 2 +- publish/package.groovy | 2 +- publish/promptingpublish.groovy | 2 +- publish/publish.groovy | 2 +- release/release.groovy | 2 +- staticanalysis/ccm.groovy | 2 +- staticanalysis/cppcheck.groovy | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) diff --git a/check/build_meta.groovy b/check/build_meta.groovy index 34eed98..6e669bc 100644 --- a/check/build_meta.groovy +++ b/check/build_meta.groovy @@ -1,5 +1,5 @@ pipeline { - agent { label "${AGENT_LABEL}" } + agent { label AGENT_LABEL } stages { stage('Initial setup') { steps { diff --git a/copy/all.groovy b/copy/all.groovy index b7c4607..6d09903 100644 --- a/copy/all.groovy +++ b/copy/all.groovy @@ -1,5 +1,5 @@ pipeline { - agent { label "${AGENT_LABEL}" } + agent { label AGENT_LABEL } stages { stage('Initial setup') { steps { diff --git a/copy/esw.groovy b/copy/esw.groovy index f53e0fe..c6c0147 100644 --- a/copy/esw.groovy +++ b/copy/esw.groovy @@ -1,5 +1,5 @@ pipeline { - agent { label "${AGENT_LABEL}" } + agent { label AGENT_LABEL } stages { stage('Initial setup') { steps { diff --git a/copy/logic.groovy b/copy/logic.groovy index b880046..9585f01 100644 --- a/copy/logic.groovy +++ b/copy/logic.groovy @@ -1,5 +1,5 @@ pipeline { - agent { label "${AGENT_LABEL}" } + agent { label AGENT_LABEL } stages { stage('Initial setup') { steps { diff --git a/differences/metahierarchy.groovy b/differences/metahierarchy.groovy index 4bcdcdc..10b24a0 100644 --- a/differences/metahierarchy.groovy +++ b/differences/metahierarchy.groovy @@ -1,5 +1,5 @@ pipeline { - agent { label "${AGENT_LABEL}" } + agent { label AGENT_LABEL } stages { stage('Initial setup') { steps { diff --git a/documentation/doxygen_deploy.groovy b/documentation/doxygen_deploy.groovy index 6642256..5054c02 100644 --- a/documentation/doxygen_deploy.groovy +++ b/documentation/doxygen_deploy.groovy @@ -1,5 +1,5 @@ pipeline { - agent { label "${AGENT_LABEL}" } + agent { label AGENT_LABEL } stages { stage('Initial setup') { steps { diff --git a/publish/package.groovy b/publish/package.groovy index 3bd9565..958a614 100644 --- a/publish/package.groovy +++ b/publish/package.groovy @@ -1,5 +1,5 @@ pipeline { - agent { label "${AGENT_LABEL}" } + agent { label AGENT_LABEL } stages { stage('Initial setup') { steps { diff --git a/publish/promptingpublish.groovy b/publish/promptingpublish.groovy index 21de708..9d51915 100644 --- a/publish/promptingpublish.groovy +++ b/publish/promptingpublish.groovy @@ -1,5 +1,5 @@ pipeline { - agent { label "${AGENT_LABEL}" } + agent { label AGENT_LABEL } stages { stage('Initial setup') { steps { diff --git a/publish/publish.groovy b/publish/publish.groovy index 7beb134..82a32ad 100644 --- a/publish/publish.groovy +++ b/publish/publish.groovy @@ -1,5 +1,5 @@ pipeline { - agent { label "${AGENT_LABEL}" } + agent { label AGENT_LABEL } stages { stage('Initial setup') { steps { diff --git a/release/release.groovy b/release/release.groovy index 4220f3b..351985d 100644 --- a/release/release.groovy +++ b/release/release.groovy @@ -1,5 +1,5 @@ pipeline { - agent { label "${AGENT_LABEL}" } + agent { label AGENT_LABEL } stages { stage('Initial setup') { steps { diff --git a/staticanalysis/ccm.groovy b/staticanalysis/ccm.groovy index 68afa48..5a7c6f5 100644 --- a/staticanalysis/ccm.groovy +++ b/staticanalysis/ccm.groovy @@ -1,5 +1,5 @@ pipeline { - agent { label "${AGENT_LABEL}" } + agent { label AGENT_LABEL } stages { stage('Initial setup') { steps { diff --git a/staticanalysis/cppcheck.groovy b/staticanalysis/cppcheck.groovy index 46744f7..9455b0b 100644 --- a/staticanalysis/cppcheck.groovy +++ b/staticanalysis/cppcheck.groovy @@ -1,5 +1,5 @@ pipeline { - agent { label "${AGENT_LABEL}" } + agent { label AGENT_LABEL } stages { stage('Initial setup') { steps { From ad46491fe433740c8945bd2bc7d5494f10402754 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sun, 7 Nov 2021 08:09:49 +0000 Subject: [PATCH 044/153] Do build integrity check and post build actions --- meta/folder.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta/folder.groovy b/meta/folder.groovy index ae772c5..98be8c1 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -858,7 +858,7 @@ class MetaInfo extends GISJsonSerialised { 'comment': comment ] results.metacollection.add(this) - results.comment += ''.padRight(level) + globalreleasetag() + '\n' + results.comment += ''.padRight(level * 4) + globalreleasetag() + '\n' for (relatedmetainfo in associatedmeta) { MetaInfo othermeta = relatedmetainfo.meta results = othermeta.walkrelated(results.metacollection, results.comment, level + 1) From fa6343607616351f255d865e2481979f2d7b2c68 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sun, 7 Nov 2021 08:35:27 +0000 Subject: [PATCH 045/153] Do build integrity check and post build actions --- meta/folder.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta/folder.groovy b/meta/folder.groovy index 98be8c1..3c9f98f 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -858,7 +858,7 @@ class MetaInfo extends GISJsonSerialised { 'comment': comment ] results.metacollection.add(this) - results.comment += ''.padRight(level * 4) + globalreleasetag() + '\n' + 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) From 222a2374d0d3b88b75830f6b97729c382ce9d90c Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Mon, 8 Nov 2021 12:22:54 +0000 Subject: [PATCH 046/153] Move ethernet product script to common scripts area so it can be easily reused --- test/testethernetproduct.groovy | 196 ++++++++++++++++++++++++++++++++ 1 file changed, 196 insertions(+) create mode 100644 test/testethernetproduct.groovy diff --git a/test/testethernetproduct.groovy b/test/testethernetproduct.groovy new file mode 100644 index 0000000..4cbde8e --- /dev/null +++ b/test/testethernetproduct.groovy @@ -0,0 +1,196 @@ +import jenkins.model.Jenkins + +pipeline { + agent { label AGENT_LABEL } + stages { + stage ("Initial Setup") { + steps{ + script { + meta = load("${WORKSPACE}/autobuild/Common_scripts/autobuilder.groovy").startnonbuild(this) + } + } + } + stage ("Checkout test environment") { + steps { + script { + toolsimporter = load("${autobuilder.commonscripts()}/configuration/tools.groovy") + + def TEST_ENVIRONMENT_URL = 'git@hydra:gistest/jenkins-ethernet-test-environment.git' + def TEST_ENVIRONMENT_DIR = 'TestEnvironmentDir' + def TEST_ENVIRONMENT_REVISION = 'origin/master' + + def environmentoptions = toolsimporter.getNewToolOptions() + environmentoptions.toolName('Ethernet product test environment') + environmentoptions.toolRepo(TEST_ENVIRONMENT_URL, TEST_SOURCE_REVISION) + toolsimporter.getTool(meta, environmentoptions, TEST_ENVIRONMENT_DIR) + + TEST_ENVIRONMENT_FILE = "${TEST_ENVIRONMENT_DIR}/environment.json" + def alltestenvironment = readJSON(file: "${TEST_ENVIRONMENT_FILE}") + TEST_ENVIRONMENT = alltestenvironment[ETHERNET_PRODUCT_TO_RUN_TEST] + echo "Selected environment:\n${TEST_ENVIRONMENT}" + } + } + } + stage ('Setup') { + agent { label TEST_ENVIRONMENT['FTDI_AGENT'] } + stages { + stage ("Checkout dependencies") { + steps { + script { + def PYTHON_URL = 'git@hydra:tools/python.git' + if (isUnix()) { + PYTHON_REVISION = 'origin/3.6.3_linux' + } + else { + PYTHON_REVISION = 'origin/3.8.10_windows_for_test' + } + PYTHONDIR = "${WORKSPACE}/python" + + def pythonimportoptions = toolsimporter.getNewToolOptions() + pythonimportoptions.toolName('Python') + pythonimportoptions.toolRepo(PYTHON_URL, PYTHON_REVISION) + toolsimporter.getTool(meta, pythonimportoptions, PYTHONDIR) + if (isUnix()) { + env.PYTHON = "${PYTHONDIR}/usr/local/bin/python3" + } + else { + env.PYTHON = "${PYTHONDIR}/ver/python.exe" + } + + def TEST_SOURCE_URL = 'git@hydra:hmb_regression/hmb_fd_hv_tests.git' + TEST_SUITE_DIR = 'TestSuiteDir' + env.GIS_TEST_SUITE_HOME = "${WORKSPACE}/${TEST_SUITE_DIR}" + + def regressiontestimportoptions = toolsimporter.getNewToolOptions() + regressiontestimportoptions.toolName('Tests') + regressiontestimportoptions.toolRepo(TEST_SOURCE_URL, TEST_SOURCE_REVISION) + toolsimporter.getTool(meta, regressiontestimportoptions, GIS_TEST_SUITE_HOME) + + env.HISTORY_FOLDER = "${WORKSPACE}/testhistory" + + def resultimportoptions = toolsimporter.getNewToolOptions() + resultimportoptions.toolName('Test history') + resultimportoptions.toolRepo(HISTORY_REPO, HISTORY_REVISION) + toolsimporter.getTool(meta, resultimportoptions, HISTORY_FOLDER) + + def CORE_SOURCE_URL = 'git@hydra:gistest/giscorelite.git' + env.GIS_TEST_SUITE_CORE = "${WORKSPACE}/GisCore" + + def coreimportoptions = toolsimporter.getNewToolOptions() + coreimportoptions.toolName('Test core') + coreimportoptions.toolRepo(CORE_SOURCE_URL, CORE_SOURCE_REVISION) + toolsimporter.getTool(meta, coreimportoptions, GIS_TEST_SUITE_CORE) + + def FTDI_SOURCE_URL = 'git@hydra:python_scripts/ftdi_relay.git' + def FTDI_SOURCE_REVISION = 'origin/Core-98' + FTDI_SOURCE_DIR = "${WORKSPACE}/PowerController" + + def ftdiimportoptions = toolsimporter.getNewToolOptions() + ftdiimportoptions.toolName('FTDI relay driver') + ftdiimportoptions.toolRepo(FTDI_SOURCE_URL, FTDI_SOURCE_REVISION) + toolsimporter.getTool(meta, ftdiimportoptions, FTDI_SOURCE_DIR) + + } + } + } + stage ("Import application to test") { + steps { + script { + importer = load("${autobuilder.commonscripts()}/import/importer.groovy") + + APPLICATION_UNDER_TEST = 'application_under_test' + env.APPLICATION_ARTIFACT_FOLDER = "${WORKSPACE}/${APPLICATION_UNDER_TEST}" + + def applicationimportoptions = importer.getNewImportOptions() + applicationimportoptions.jenkinsjob(APPLICATION_ARTIFACT_PROJECT, APPLICATION_ARTIFACT_SELECTOR) + applicationimportoptions.setfilter('app_package/**,control_package/**') + applicationmeta = importer.artifactimport(meta, applicationimportoptions, APPLICATION_ARTIFACT_FOLDER) + + meta.productinfo.set(applicationmeta.productinfo) + meta.productinfo.subcomponentname = "${applicationmeta.productinfo.subcomponentname}_TEST" + meta.gitinfo.set(applicationmeta.gitinfo) + meta.buildstampinfo.set(applicationmeta.buildstampinfo) + } + } + } + stage("Clean") { + steps { + script { + LOGGING_ROOT = 'Logging' + env.GIS_TEST_OUTPUT_LOGGING_ROOT = "${WORKSPACE}/${LOGGING_ROOT}" + cleanfolders = [ + GIS_TEST_OUTPUT_LOGGING_ROOT, + ] + cleaner = load("${autobuilder.commonscripts()}/clean/clean.groovy") + cleaner.clean(cleanfolders) + } + } + } + stage ('Test') { + steps { + script { + lock(TEST_ENVIRONMENT['RESOURCE_LOCK']) { + if (POWER_CYCLE_HARDWARE == 'true') { + dir(FTDI_SOURCE_DIR) { + bat """ + "${PYTHON}" "${FTDI_SOURCE_DIR}/RegressionPower.py" -d ${TEST_ENVIRONMENT['FTDI_RELAY_DEVICE']} -o True + """ + } + } + if (UPDATE_HARDWARE == 'true') { + dir(GIS_TEST_SUITE_CORE) { + bat """ + "${PYTHON}" "${GIS_TEST_SUITE_CORE}/HMBCommon/hmbPackageDeployer.py" -p "${APPLICATION_ARTIFACT_FOLDER}" -t "${TEST_ENVIRONMENT['IP_ADDRESS']}" + """ + rc = bat (script:""" + "${PYTHON}" "${GIS_TEST_SUITE_CORE}/HMBCommon/hmbinspectstate.py" + """, + returnStatus: true) + if (rc == 1) { + unstable('FAILED while inspecting state of hardware') + } + } + } + if (DO_TEST == 'true') { + rc = bat(script:""" + ${PYTHON} "${GIS_TEST_SUITE_CORE}/GISTestMaster.py" -w ${PRODUCT_LOCATION_UNDER_TEST} -fl --include ${TEST_INCLUDE_FILTER} + """, + returnStatus: true + ) + if (rc == 1) { + unstable('FAILED while running tests') + } + } + } + } + } + } + } + } + stage("Archive Test History") { + steps{ + script { + dir(HISTORY_FOLDER) { + rc = bat (script:""" + "${PYTHON}" "GitCyclicPush.py" + """, + returnStatus: true + ) + if (rc == 1) { + unstable('FAILED to process history') + } + } + } + } + } + stage("Archive test artifacts"){ + steps{ + script { + def artifactlist = meta.generateartifacts([ "${LOGGING_ROOT}/**"]) + archiveArtifacts artifactlist + } + } + } + } +} + From 058bfbbc401f54bbf27f6cdf0b86ea1ca9fa4402 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Mon, 8 Nov 2021 14:49:06 +0000 Subject: [PATCH 047/153] Seperate history processing from results --- test/testethernetproduct.groovy | 33 ++++++++++++++++++++------------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/test/testethernetproduct.groovy b/test/testethernetproduct.groovy index 4cbde8e..7314343 100644 --- a/test/testethernetproduct.groovy +++ b/test/testethernetproduct.groovy @@ -90,6 +90,13 @@ pipeline { ftdiimportoptions.toolRepo(FTDI_SOURCE_URL, FTDI_SOURCE_REVISION) toolsimporter.getTool(meta, ftdiimportoptions, FTDI_SOURCE_DIR) + def HISTORY_PROCESSING_REPO = 'git@hydra:python_scripts/hmb_results_history_processing.git' + HISTORY_PROCESSING_DIR = "${WORKSPACE}/HistoryProcessing" + + def resultprocessingoptions = toolsimporter.getNewToolOptions() + resultprocessingoptions.toolName('History processing') + resultprocessingoptions.toolRepo(HISTORY_PROCESSING_REPO, HISTORY_PROCESSING_REVISION) + toolsimporter.getTool(meta, resultprocessingoptions, HISTORY_PROCESSING_DIR) } } } @@ -165,19 +172,19 @@ pipeline { } } } - } - } - stage("Archive Test History") { - steps{ - script { - dir(HISTORY_FOLDER) { - rc = bat (script:""" - "${PYTHON}" "GitCyclicPush.py" - """, - returnStatus: true - ) - if (rc == 1) { - unstable('FAILED to process history') + stage("Archive Test History") { + steps{ + script { + dir(HISTORY_FOLDER) { + rc = bat (script:""" + "${PYTHON}" "${HISTORY_PROCESSING_DIR}/GitCyclicPush.py" + """, + returnStatus: true + ) + if (rc == 1) { + unstable('FAILED to process history') + } + } } } } From df5d9938e24484fe5c6f1975124b28a51834c67b Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Mon, 8 Nov 2021 14:57:27 +0000 Subject: [PATCH 048/153] Seperate history processing from results --- test/testethernetproduct.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/testethernetproduct.groovy b/test/testethernetproduct.groovy index 7314343..21f89db 100644 --- a/test/testethernetproduct.groovy +++ b/test/testethernetproduct.groovy @@ -90,7 +90,7 @@ pipeline { ftdiimportoptions.toolRepo(FTDI_SOURCE_URL, FTDI_SOURCE_REVISION) toolsimporter.getTool(meta, ftdiimportoptions, FTDI_SOURCE_DIR) - def HISTORY_PROCESSING_REPO = 'git@hydra:python_scripts/hmb_results_history_processing.git' + def HISTORY_PROCESSING_REPO = 'git@hydra:gistestresults/ethernet-products-history-processing.git' HISTORY_PROCESSING_DIR = "${WORKSPACE}/HistoryProcessing" def resultprocessingoptions = toolsimporter.getNewToolOptions() From c6d435c1570a73abb4d7021178195f24eaa17b00 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Mon, 8 Nov 2021 15:33:55 +0000 Subject: [PATCH 049/153] Change name of repo as its current name is misleading --- test/testethernetproduct.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/testethernetproduct.groovy b/test/testethernetproduct.groovy index 21f89db..564fd5b 100644 --- a/test/testethernetproduct.groovy +++ b/test/testethernetproduct.groovy @@ -57,7 +57,7 @@ pipeline { env.PYTHON = "${PYTHONDIR}/ver/python.exe" } - def TEST_SOURCE_URL = 'git@hydra:hmb_regression/hmb_fd_hv_tests.git' + def TEST_SOURCE_URL = 'git@hydra:hmb_regression/hmb_tests.git' TEST_SUITE_DIR = 'TestSuiteDir' env.GIS_TEST_SUITE_HOME = "${WORKSPACE}/${TEST_SUITE_DIR}" From a14d8b94b7519f7340e4b2deda7497c0048eda35 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Mon, 8 Nov 2021 18:14:32 +0000 Subject: [PATCH 050/153] Submit logging artifacts in the relevant agent environment --- test/testethernetproduct.groovy | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/testethernetproduct.groovy b/test/testethernetproduct.groovy index 564fd5b..bcea28a 100644 --- a/test/testethernetproduct.groovy +++ b/test/testethernetproduct.groovy @@ -189,12 +189,12 @@ pipeline { } } } - } - stage("Archive test artifacts"){ - steps{ - script { - def artifactlist = meta.generateartifacts([ "${LOGGING_ROOT}/**"]) - archiveArtifacts artifactlist + stage("Archive test artifacts"){ + steps{ + script { + def artifactlist = meta.generateartifacts([ "${LOGGING_ROOT}/**"]) + archiveArtifacts artifactlist + } } } } From bc6a637c5907ab534d9a220268aa56676be07d17 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Mon, 8 Nov 2021 18:17:12 +0000 Subject: [PATCH 051/153] Submit logging artifacts in the relevant agent environment --- test/testethernetproduct.groovy | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/testethernetproduct.groovy b/test/testethernetproduct.groovy index bcea28a..92d6414 100644 --- a/test/testethernetproduct.groovy +++ b/test/testethernetproduct.groovy @@ -188,12 +188,12 @@ pipeline { } } } - } - stage("Archive test artifacts"){ - steps{ - script { - def artifactlist = meta.generateartifacts([ "${LOGGING_ROOT}/**"]) - archiveArtifacts artifactlist + stage("Archive test artifacts"){ + steps{ + script { + def artifactlist = meta.generateartifacts([ "${LOGGING_ROOT}/**"]) + archiveArtifacts artifactlist + } } } } From e8ea9a29325af9f421560eefb97dc540a0fac420 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 9 Nov 2021 12:07:09 +0000 Subject: [PATCH 052/153] Perform a deep copy of version objects --- meta/folder.groovy | 16 ++++++++++++++++ versionnumbering/generate.groovy | 8 ++++++-- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/meta/folder.groovy b/meta/folder.groovy index 3c9f98f..aee84f6 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -108,6 +108,15 @@ class GitInfo extends GISJsonSerialised { this.remoteinfo = remoteinfo } + GitInfo(GitInfo another) { + super(another.script) + this.sourcepath = another.sourcepath + this.sourcerevision = another.sourcerevision + this.gitrevision = another.gitrevision + this.remoteurl = another.remoteurl + this.remoteinfo = another.remoteinfo + } + void set(String sourcepath, String sourcerevision, String gitrevision, String remoteurl, String remoteinfo) { this.sourcepath = sourcepath this.sourcerevision = sourcerevision @@ -267,6 +276,13 @@ class BuildStampInfo extends GISJsonSerialised { this.buildstamp = buildstamp } + BuildStampInfo(BuildStampInfo another) { + super(another.script) + this.buildstampprefix = another.buildstampprefix + this.revision = another.revision + this.buildstamp = another.buildstamp + } + void set(String buildstampprefix, int revision, String buildstamp) { this.buildstampprefix = buildstampprefix this.revision = revision diff --git a/versionnumbering/generate.groovy b/versionnumbering/generate.groovy index 405b7be..a1ab40f 100644 --- a/versionnumbering/generate.groovy +++ b/versionnumbering/generate.groovy @@ -160,8 +160,12 @@ String generate(meta, String sourcerevision, String sourcepath, String basebuild } String copyfrom(meta, othermeta) { - meta.gitinfo = othermeta.gitinfo - meta.buildstampinfo = othermeta.buildstampinfo + // Deep copy + def newgitinfo = othermeta.gitinfo.getClass().newInstance(othermeta.gitinfo) + def newbuildstampinfo = othermeta.buildstampinfo.getClass().newInstance(othermeta.buildstampinfo) + + meta.gitinfo = newgitinfo + meta.buildstampinfo = newbuildstampinfo return meta.buildstampinfo.buildstamp } From b6c8034e227213a6b66617bbcd94718e01aa6571 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 9 Nov 2021 15:08:56 +0000 Subject: [PATCH 053/153] Perform a deep copy of version objects --- versionnumbering/generate.groovy | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/versionnumbering/generate.groovy b/versionnumbering/generate.groovy index a1ab40f..3c087c4 100644 --- a/versionnumbering/generate.groovy +++ b/versionnumbering/generate.groovy @@ -161,8 +161,8 @@ String generate(meta, String sourcerevision, String sourcepath, String basebuild String copyfrom(meta, othermeta) { // Deep copy - def newgitinfo = othermeta.gitinfo.getClass().newInstance(othermeta.gitinfo) - def newbuildstampinfo = othermeta.buildstampinfo.getClass().newInstance(othermeta.buildstampinfo) + def newgitinfo = othermeta.gitinfo.getClass().newInstance([othermeta.gitinfo]) + def newbuildstampinfo = othermeta.buildstampinfo.getClass().newInstance([othermeta.buildstampinfo]) meta.gitinfo = newgitinfo meta.buildstampinfo = newbuildstampinfo From 1bf6056e6c08c9143a25f05e5f13ec0ad0daf1e1 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 9 Nov 2021 16:55:51 +0000 Subject: [PATCH 054/153] Perform a deep copy of version objects --- versionnumbering/generate.groovy | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/versionnumbering/generate.groovy b/versionnumbering/generate.groovy index 3c087c4..6e0db11 100644 --- a/versionnumbering/generate.groovy +++ b/versionnumbering/generate.groovy @@ -161,11 +161,8 @@ String generate(meta, String sourcerevision, String sourcepath, String basebuild String copyfrom(meta, othermeta) { // Deep copy - def newgitinfo = othermeta.gitinfo.getClass().newInstance([othermeta.gitinfo]) - def newbuildstampinfo = othermeta.buildstampinfo.getClass().newInstance([othermeta.buildstampinfo]) - - meta.gitinfo = newgitinfo - meta.buildstampinfo = newbuildstampinfo + meta.gitinfo.set(othermeta.gitinfo.sourcepath, othermeta.gitinfo.sourcerevision, othermeta.gitinfo.gitrevision, othermeta.gitinfo.remoteurl, othermeta.gitinfo.remoteinfo) + meta.buildstampinfo.set(othermeta.buildstampinfo.buildstampprefix, othermeta.buildstampinfo.revision, othermeta.buildstampinfo.buildstamp) return meta.buildstampinfo.buildstamp } From ec0b7d77d8ccf21ded0427add902cad5b0b0c709 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Fri, 12 Nov 2021 13:17:14 +0000 Subject: [PATCH 055/153] Use the version of print server that atlas services is using - so that there are less build configuration issues --- meta/folder.groovy | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/meta/folder.groovy b/meta/folder.groovy index aee84f6..a084220 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -890,6 +890,23 @@ class MetaInfo extends GISJsonSerialised { MetaInfo getNewMetaObject(script) { return new MetaInfo(script) } + + def findAssociatedMeta(String productname, String subcomponentname) { + def results = [ + 'matchedmeta' : getNewMetaObject(this), + 'matchfound' : false + ] + def results = allrelatedmeta() + for (dependentmeta in results.metacollection) { + if (dependentmeta.productinfo.productname == productname && + dependentmeta.productinfo.subcomponentname == componentname) { + results.matchedmeta = dependentmeta + results.matchfound = true + break + } + } + return results + } } MetaInfo metareset(script) { From 904f3c4c6dc419ae1b5adc451788995d17f0ee51 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Fri, 12 Nov 2021 13:19:52 +0000 Subject: [PATCH 056/153] Use the version of print server that atlas services is using - so that there are less build configuration issues --- meta/folder.groovy | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meta/folder.groovy b/meta/folder.groovy index a084220..884c8c4 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -896,8 +896,8 @@ class MetaInfo extends GISJsonSerialised { 'matchedmeta' : getNewMetaObject(this), 'matchfound' : false ] - def results = allrelatedmeta() - for (dependentmeta in results.metacollection) { + def walkresults = allrelatedmeta() + for (dependentmeta in walkresults.metacollection) { if (dependentmeta.productinfo.productname == productname && dependentmeta.productinfo.subcomponentname == componentname) { results.matchedmeta = dependentmeta From 458a2e2b19b5ae93e097cc2d57d21adee255c13a Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Fri, 12 Nov 2021 13:26:08 +0000 Subject: [PATCH 057/153] Use the version of print server that atlas services is using - so that there are less build configuration issues --- import/importer.groovy | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/import/importer.groovy b/import/importer.groovy index 8624421..4d0b313 100644 --- a/import/importer.groovy +++ b/import/importer.groovy @@ -276,7 +276,7 @@ def artifactimport(meta, boolean fingerprint = false, boolean nested = false) { echo "DEPRECATED method: artifactimport(meta, String source, String jenkinsjob, buildnumberorselector, String repo, String revision, String destpath ...)" - def importoptions = getNewImportOptions() + def importoptions = importer.getNewImportOptions() importoptions.source(sourceselect, jenkinsjob, buildnumberorselector, repo, revision) importoptions.setincrementversionnumber(incrementversionnumber) @@ -298,7 +298,7 @@ def artifactimport(meta, String excludes = '', boolean fingerprint = false) { echo "DEPRECATED method: artifactimport(meta, String buildjob, int buildnumber, String destpath, ...)" - def importoptions = getNewImportOptions() + def importoptions = importer.getNewImportOptions() importoptions.jenkinsjob(buildjob, " ${buildnumber}") importoptions.setincrementversionnumber(incrementversionnumber) @@ -319,7 +319,7 @@ def artifactimport(meta, String excludes = '', boolean fingerprint = false) { echo "DEPRECATED method: artifactimport(meta, String buildjob, buildnumberorselector, String destpath, ...)" - def importoptions = getNewImportOptions() + def importoptions = importer.getNewImportOptions() importoptions.jenkinsjob(buildjob, buildnumberorselector) importoptions.setincrementversionnumber(incrementversionnumber) From 68422e3026aa24872feced8fcb4303553aee961c Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Fri, 12 Nov 2021 13:28:30 +0000 Subject: [PATCH 058/153] Use the version of print server that atlas services is using - so that there are less build configuration issues --- meta/folder.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta/folder.groovy b/meta/folder.groovy index 884c8c4..a908ab1 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -899,7 +899,7 @@ class MetaInfo extends GISJsonSerialised { def walkresults = allrelatedmeta() for (dependentmeta in walkresults.metacollection) { if (dependentmeta.productinfo.productname == productname && - dependentmeta.productinfo.subcomponentname == componentname) { + dependentmeta.productinfo.subcomponentname == subcomponentname) { results.matchedmeta = dependentmeta results.matchfound = true break From 6a8d736299a7ce65d84d70fb16b525327e6f806f Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Fri, 12 Nov 2021 13:33:49 +0000 Subject: [PATCH 059/153] Use the version of print server that atlas services is using - so that there are less build configuration issues --- meta/folder.groovy | 1 + 1 file changed, 1 insertion(+) diff --git a/meta/folder.groovy b/meta/folder.groovy index a908ab1..694a40c 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -900,6 +900,7 @@ class MetaInfo extends GISJsonSerialised { for (dependentmeta in walkresults.metacollection) { if (dependentmeta.productinfo.productname == productname && dependentmeta.productinfo.subcomponentname == subcomponentname) { + script.echo("Found matching component: ${dependentmeta.globalreleasetag()}") results.matchedmeta = dependentmeta results.matchfound = true break From 5ee449e22b1f9f4a2e63249745c47afc68f90224 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sat, 13 Nov 2021 00:02:28 +0000 Subject: [PATCH 060/153] Handle different types of build selector parameter --- import/importer.groovy | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/import/importer.groovy b/import/importer.groovy index 4d0b313..9820ab1 100644 --- a/import/importer.groovy +++ b/import/importer.groovy @@ -96,9 +96,18 @@ class ImportOptions { m_appendtoparentmeta = appendtoparentmeta } - void jenkinsjob(String jobname, String buildnumberorselector) { + void jenkinsjob(String jobname, buildnumberorselector) { m_jobname = jobname.trim() - m_buildnumberorselector = buildnumberorselector.trim() + m_buildnumberorselector = [ + $class: 'ParameterizedBuildSelector', + parameterName: buildnumberorselector + ] + setsourceselect('Jenkins job artifact') + } + + void jenkinsjob(String jobname, int buildnumberorselector) { + m_jobname = jobname.trim() + m_buildnumberorselector = specific("${buildnumberorselector}") setsourceselect('Jenkins job artifact') } @@ -147,15 +156,14 @@ def artifactimportfrombuildjob(meta, importoptions, String destpath) { conditionalClean(importoptions, destpath) + echo "Build selector type: ${importoptions.m_buildnumberorselector.getClass()}" + copyArtifacts( filter: formFilter(importoptions), excludes: importoptions.m_excludes, fingerprintArtifacts: importoptions.m_fingerprint, projectName: importoptions.m_jobname, - selector: [ - $class: 'ParameterizedBuildSelector', - parameterName: importoptions.m_buildnumberorselector - ], + selector: importoptions.m_buildnumberorselector, flatten: importoptions.m_flatten, target: destpath ) From ec9f9e9d474958c0f8af3235be8158f83b73ff1f Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sat, 13 Nov 2021 00:24:12 +0000 Subject: [PATCH 061/153] Handle different types of build selector parameter --- import/importer.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/import/importer.groovy b/import/importer.groovy index 9820ab1..d90bafd 100644 --- a/import/importer.groovy +++ b/import/importer.groovy @@ -107,7 +107,7 @@ class ImportOptions { void jenkinsjob(String jobname, int buildnumberorselector) { m_jobname = jobname.trim() - m_buildnumberorselector = specific("${buildnumberorselector}") + m_buildnumberorselector = specific(buildnumberorselector.toString()) setsourceselect('Jenkins job artifact') } From fe32259717702bb65cf1e8e3fd4f3944cf1ffdcf Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sat, 13 Nov 2021 00:30:44 +0000 Subject: [PATCH 062/153] Handle different types of build selector parameter --- import/importer.groovy | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/import/importer.groovy b/import/importer.groovy index d90bafd..818f0b7 100644 --- a/import/importer.groovy +++ b/import/importer.groovy @@ -107,7 +107,10 @@ class ImportOptions { void jenkinsjob(String jobname, int buildnumberorselector) { m_jobname = jobname.trim() - m_buildnumberorselector = specific(buildnumberorselector.toString()) + m_buildnumberorselector = [ + $class: 'ParameterizedBuildSelector', + parameterName: "${buildnumberorselector}" + ] setsourceselect('Jenkins job artifact') } From 7db1c3a4b18faf509712e5ae3cd3face1435b10e Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sat, 13 Nov 2021 09:52:48 +0000 Subject: [PATCH 063/153] Add a diff post build action --- build/postactions.groovy | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/build/postactions.groovy b/build/postactions.groovy index 48ca297..1619a8f 100644 --- a/build/postactions.groovy +++ b/build/postactions.groovy @@ -1,5 +1,6 @@ def performSuccessfulBuildActions() { + def String buildselector = "${BUILD_NUMBER}" if (params.DOXYGEN_DEPLOY_JOB != null) { if (DOXYGEN_DEPLOY_JOB && Jenkins.instance.getItemByFullName(DOXYGEN_DEPLOY_JOB).isBuildable()) { build( @@ -7,7 +8,7 @@ def performSuccessfulBuildActions() { job: DOXYGEN_DEPLOY_JOB, parameters: [ string(name: 'BUILD_JOB_WITH_DOXYGEN_ARTIFACTS', value: JOB_NAME), - string(name: 'BUILD_JOB_WITH_DOXYGEN_ARTIFACTS_SELECTOR', value: " ${BUILD_NUMBER}"), + string(name: 'BUILD_JOB_WITH_DOXYGEN_ARTIFACTS_SELECTOR', value: buildselector), ] ) } @@ -19,7 +20,7 @@ def performSuccessfulBuildActions() { job: STATIC_ANALYSIS_JOB, parameters: [ string(name: 'APPLICATION_ARTIFACT_PROJECT', value: JOB_NAME), - string(name: 'APPLICATION_ARTIFACT_SELECTOR', value: " ${BUILD_NUMBER}"), + string(name: 'APPLICATION_ARTIFACT_SELECTOR', value: buildselector), ] ) } @@ -31,7 +32,7 @@ def performSuccessfulBuildActions() { job: UNIT_TEST_JOB, parameters: [ string(name: 'APPLICATION_ARTIFACT_PROJECT', value: JOB_NAME), - string(name: 'APPLICATION_ARTIFACT_SELECTOR', value: " ${BUILD_NUMBER}"), + string(name: 'APPLICATION_ARTIFACT_SELECTOR', value: buildselector), ] ) } @@ -43,7 +44,20 @@ def performSuccessfulBuildActions() { job: REGRESSION_TEST_JOB, parameters: [ string(name: 'APPLICATION_ARTIFACT_PROJECT', value: JOB_NAME), - string(name: 'APPLICATION_ARTIFACT_SELECTOR', value: " ${BUILD_NUMBER}"), + string(name: 'APPLICATION_ARTIFACT_SELECTOR', value: buildselector, + ] + ) + } + } + if (params.DIFF_JOB != null) { + if (DIFF_JOB && Jenkins.instance.getItemByFullName(DIFF_JOB).isBuildable()) { + build( + wait: false, + job: DIFF_JOB, + parameters: [ + string(name: 'LATER_SOURCE', 'Jenkins job artifact'), + string(name: 'LATER_BUILD_JOB', value: JOB_NAME), + string(name: 'LATER_BUILD_SELECTOR', value: buildselector), ] ) } @@ -55,7 +69,7 @@ def performSuccessfulBuildActions() { job: RELEASE_TO_GIT_JOB, parameters: [ string(name: 'BUILD_JOB', value: JOB_NAME), - string(name: 'BUILD_JOB_SELECTOR', value: " ${BUILD_NUMBER}"), + string(name: 'BUILD_JOB_SELECTOR', value: buildselector), ] ) } From c87c3bbb94eddf9070107444bf9c8e85b759ef4e Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sat, 13 Nov 2021 11:29:12 +0000 Subject: [PATCH 064/153] Add a diff post build action --- build/postactions.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/postactions.groovy b/build/postactions.groovy index 1619a8f..4059da7 100644 --- a/build/postactions.groovy +++ b/build/postactions.groovy @@ -44,7 +44,7 @@ def performSuccessfulBuildActions() { job: REGRESSION_TEST_JOB, parameters: [ string(name: 'APPLICATION_ARTIFACT_PROJECT', value: JOB_NAME), - string(name: 'APPLICATION_ARTIFACT_SELECTOR', value: buildselector, + string(name: 'APPLICATION_ARTIFACT_SELECTOR', value: buildselector), ] ) } From a86ca86b3ee55a2c08c5e76f83618f1c69615899 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sat, 13 Nov 2021 11:59:15 +0000 Subject: [PATCH 065/153] Update parameter usage on git checkout --- versioncontrol/git.groovy | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/versioncontrol/git.groovy b/versioncontrol/git.groovy index 50f4025..a22054b 100644 --- a/versioncontrol/git.groovy +++ b/versioncontrol/git.groovy @@ -194,14 +194,14 @@ def docheckout(String gitURL, String revision, int cloneDepth, String reporootpa branches: [ [name: revision] ], - doGenerateSubmoduleConfigurations: false, 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], [$class: 'SparseCheckoutPaths', sparseCheckoutPaths: sparsecheckoutconfig(sparseitemlist)], + [$class: 'PruneStaleBranch'], ], submoduleCfg: [], ]) From 0ac129bc90340112a32bafcc65578b0b3d6820f4 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sat, 13 Nov 2021 15:48:55 +0000 Subject: [PATCH 066/153] Resurrect ccm --- staticanalysis/ccm.groovy | 46 ++++++++++----------------------------- 1 file changed, 11 insertions(+), 35 deletions(-) diff --git a/staticanalysis/ccm.groovy b/staticanalysis/ccm.groovy index 5a7c6f5..0be80fa 100644 --- a/staticanalysis/ccm.groovy +++ b/staticanalysis/ccm.groovy @@ -13,12 +13,6 @@ pipeline { script { configurationhelper = autobuilder.configurationhelper() - PYTHONURL = 'git@hydra:tools/python.git' - PYTHONBRANCH = 'origin/3.6.3_windows' - PYTHONDIR = "${WORKSPACE}/python" - configurationhelper.gitCheckoutAndRegister(meta, 'python', PYTHONURL, PYTHONBRANCH, PYTHONDIR) - env.PYTHON = "${PYTHONDIR}/ver/python.exe" - CCMURL = 'git@hydra:tools/ccm.git' CCMBRANCH = 'origin/master' CCMDIR = "${WORKSPACE}/ccm" @@ -41,9 +35,9 @@ pipeline { stage("Clean exports") { steps { script { - STATICANALYSIS = 'staticanalysis' + RESULTS = 'results' cleanfolders = [ - STATICANALYSIS, + RESULTS, ] cleaner = load("${autobuilder.commonscripts()}/clean/clean.groovy") cleaner.clean(cleanfolders) @@ -61,18 +55,19 @@ pipeline { stage('Static analysis') { steps { script { - def CCMOLDER = "${STATICANALYSIS}/ccm" - dir(CCMOLDER) { - echo "Executing: ${CCM} ${SRC} /xml /nummetrics=100 > ccm.xml" + def ccmconfigurationfile = "${WORKSPACE}/ccm.xml" + writeFile(file: ccmconfigurationfile, text: CCM_CONFIGURATION) + echo "Configuration file: ${ccmconfigurationfile} contains:\n${CCM_CONFIGURATION}" + + dir(RESULTS) { + echo "Executing: ${CCM} ${ccmconfigurationfile} > ccm.xml" if (isUnix()) { sh """#!/bin/bash - find "${SRC}" -type f ! -name "*.cpp" -a ! -name "*.h" -a ! -name "*.hpp" -a ! -name "*.c" -exec rm -r {} \\; - # Uses mono - "${CCM}" "${SRC}" /xml /nummetrics=100 > ccm.xml + ${CCM}" "${ccmconfigurationfile}" > ccm.xml """ } else { - bat """ - "${CCM}" "${SRC}" /xml /nummetrics=100 > ccm.xml + powershell """ + "${CCM}" "${ccmconfigurationfile}" > ccm.xml """ } } @@ -82,25 +77,6 @@ pipeline { } } } - stage('Classifying publishable artifacts') { - steps { - script { - def publishable = [ - ] - publishutils = load("${autobuilder.commonscripts()}/publishing/utils.groovy") - publishutils.generatelist(meta, publishable) - } - } - } - stage('Archiving artifacts') { - steps { - script { - ArrayList itemsForRelease = ["${STATICANALYSIS}/**"] - def artifactlist = meta.generateartifacts(itemsForRelease) - archiveArtifacts artifactlist - } - } - } } post { always { From ca5436bfafa668911f63ad84faac4924c7332fba Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sat, 13 Nov 2021 15:57:15 +0000 Subject: [PATCH 067/153] Resurrect ccm --- staticanalysis/ccm.groovy | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/staticanalysis/ccm.groovy b/staticanalysis/ccm.groovy index 0be80fa..6fa2b82 100644 --- a/staticanalysis/ccm.groovy +++ b/staticanalysis/ccm.groovy @@ -24,11 +24,8 @@ pipeline { stage('Checkout source') { steps { script { - SOURCEREVISION = "${SOURCE_REVISION}" SOURCEDIR = "${WORKSPACE}/source" - configurationhelper.gitCheckoutAndRegister(meta, 'source', SOURCEURL, SOURCEREVISION, SOURCEDIR, '', 0, false) - SOURCE_PATH = "${SOURCEDIR}" - env.SRC = "${SOURCE_PATH}/${SOURCE_OFFSET_PATH}" + configurationhelper.gitCheckoutAndRegister(meta, 'source', SOURCEURL, SOURCE_REVISION, SOURCEDIR, '', 0, false) } } } @@ -44,14 +41,6 @@ pipeline { } } } - stage('Generating version info') { - steps { - script { - version = load("${autobuilder.commonscripts()}/versionnumbering/generate.groovy") - version.generate(meta, SOURCE_REVISION, SOURCE_PATH) - } - } - } stage('Static analysis') { steps { script { From 5d8860f95166872aa9afd1a43dadea04764d9042 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sat, 13 Nov 2021 16:18:59 +0000 Subject: [PATCH 068/153] Resurrect ccm --- staticanalysis/ccm.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/staticanalysis/ccm.groovy b/staticanalysis/ccm.groovy index 6fa2b82..46e0dac 100644 --- a/staticanalysis/ccm.groovy +++ b/staticanalysis/ccm.groovy @@ -55,7 +55,7 @@ pipeline { ${CCM}" "${ccmconfigurationfile}" > ccm.xml """ } else { - powershell """ + bat """ "${CCM}" "${ccmconfigurationfile}" > ccm.xml """ } From 2d3aa7f462b54d1807f744d10274515f1be98843 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sat, 13 Nov 2021 16:47:01 +0000 Subject: [PATCH 069/153] Resurrect ccm --- staticanalysis/ccm.groovy | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/staticanalysis/ccm.groovy b/staticanalysis/ccm.groovy index 46e0dac..ae91cb0 100644 --- a/staticanalysis/ccm.groovy +++ b/staticanalysis/ccm.groovy @@ -55,8 +55,9 @@ pipeline { ${CCM}" "${ccmconfigurationfile}" > ccm.xml """ } else { + echo "Executing: ${WINDOWS_COMMANDLINE_ENVIRONMENT} \"${CCM}\" \"${ccmconfigurationfile}\" > ccm.xml" bat """ - "${CCM}" "${ccmconfigurationfile}" > ccm.xml + ${WINDOWS_COMMANDLINE_ENVIRONMENT} "${CCM}" "${ccmconfigurationfile}" > ccm.xml """ } } From b04f5b063300d7fd0d8089ca7c41c87b63247c23 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sat, 13 Nov 2021 18:33:23 +0000 Subject: [PATCH 070/153] Add a diff post build action --- build/postactions.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/postactions.groovy b/build/postactions.groovy index 4059da7..90fcc15 100644 --- a/build/postactions.groovy +++ b/build/postactions.groovy @@ -55,7 +55,7 @@ def performSuccessfulBuildActions() { wait: false, job: DIFF_JOB, parameters: [ - string(name: 'LATER_SOURCE', 'Jenkins job artifact'), + string(name: 'LATER_SOURCE', value: 'Jenkins job artifact'), string(name: 'LATER_BUILD_JOB', value: JOB_NAME), string(name: 'LATER_BUILD_SELECTOR', value: buildselector), ] From 92e165bdc53fddffa4e338bd46886371aa154837 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sun, 14 Nov 2021 16:44:23 +0000 Subject: [PATCH 071/153] Check for product components using the same release git url --- build/integrity.groovy | 39 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/build/integrity.groovy b/build/integrity.groovy index 73d5d46..7c0f66f 100644 --- a/build/integrity.groovy +++ b/build/integrity.groovy @@ -10,6 +10,7 @@ def check(buildmeta) { def allmeta = buildmeta.allrelatedmeta() echo "All meta:\n${allmeta.comment}" + // Store build stamps associated with each product component; Store a counter against each product component version def productcomponents = [:] for (meta in allmeta.metacollection) { def key = meta.componentidentifier() @@ -24,9 +25,13 @@ def check(buildmeta) { productcomponents[key][buildstampnumber] += 1 } } + + // Show what was collected echo prettyPrint(toJson(productcomponents)) + + // Look for product components with more than one build stamp for (pc in productcomponents.keySet()) { - bsns = productcomponents[pc] + def bsns = productcomponents[pc] if (bsns.size() > 1) { results.good = false results.comment += "There is more than one version of Product component: ${pc} being used in this build:\n" @@ -35,6 +40,38 @@ def check(buildmeta) { } } } + + // Store product components associated with each release git url + def releasegiturls = [:] + for (meta in allmeta.metacollection) { + def key = meta.gitinfo.remoteurl + + if (!releasegiturls.containsKey(key)) { + releasegiturls[key] = [:] + } + def componentidentifier = meta.componentidentifier() + if (!releasegiturls[key].containsKey(componentidentifier)) { + releasegiturls[key][componentidentifier] = 1 + } else { + releasegiturls[key][componentidentifier] += 1 + } + } + + // Show what was collected + echo prettyPrint(toJson(releasegiturls)) + + // Look for product components with more than one build stamp + for (rgu in releasegiturls.keySet()) { + def cis = releasegiturls[rgu] + if (cis.size() > 1) { + results.good = false + results.comment += "There is more than one product component associated with a release git url: ${rgu} being used in this build:\n" + for (ci in cis.keySet()) { + results.comment += "${ci}\n" + } + } + } + return results } From c8373c6f8917bf82f305155342daa1bc07f4cd09 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sun, 14 Nov 2021 17:23:08 +0000 Subject: [PATCH 072/153] Check for product components using the same release git url --- build/integrity.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/integrity.groovy b/build/integrity.groovy index 7c0f66f..435e0e8 100644 --- a/build/integrity.groovy +++ b/build/integrity.groovy @@ -44,7 +44,7 @@ def check(buildmeta) { // Store product components associated with each release git url def releasegiturls = [:] for (meta in allmeta.metacollection) { - def key = meta.gitinfo.remoteurl + def key = meta.releaseinfo.releaserepoURL if (!releasegiturls.containsKey(key)) { releasegiturls[key] = [:] From 3d2a10386fd57d4bcc1c20e2410fe30328e54588 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sun, 14 Nov 2021 18:07:06 +0000 Subject: [PATCH 073/153] Check for product components using the same release git url --- build/integrity.groovy | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/build/integrity.groovy b/build/integrity.groovy index 435e0e8..51370e4 100644 --- a/build/integrity.groovy +++ b/build/integrity.groovy @@ -44,16 +44,18 @@ def check(buildmeta) { // Store product components associated with each release git url def releasegiturls = [:] for (meta in allmeta.metacollection) { - def key = meta.releaseinfo.releaserepoURL + def String key = meta.releaseinfo.releaserepoURL - if (!releasegiturls.containsKey(key)) { - releasegiturls[key] = [:] - } - def componentidentifier = meta.componentidentifier() - if (!releasegiturls[key].containsKey(componentidentifier)) { - releasegiturls[key][componentidentifier] = 1 - } else { - releasegiturls[key][componentidentifier] += 1 + if (key) { + if (!releasegiturls.containsKey(key)) { + releasegiturls[key] = [:] + } + def componentidentifier = meta.componentidentifier() + if (!releasegiturls[key].containsKey(componentidentifier)) { + releasegiturls[key][componentidentifier] = 1 + } else { + releasegiturls[key][componentidentifier] += 1 + } } } From ee2348896d154396249528fe697bbeb6e5caeb78 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sun, 14 Nov 2021 18:51:50 +0000 Subject: [PATCH 074/153] Check for more than one commit associated with source git urls --- build/integrity.groovy | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/build/integrity.groovy b/build/integrity.groovy index 51370e4..e93c00f 100644 --- a/build/integrity.groovy +++ b/build/integrity.groovy @@ -62,7 +62,7 @@ def check(buildmeta) { // Show what was collected echo prettyPrint(toJson(releasegiturls)) - // Look for product components with more than one build stamp + // Look for release git urls being used by more than one product component for (rgu in releasegiturls.keySet()) { def cis = releasegiturls[rgu] if (cis.size() > 1) { @@ -74,6 +74,39 @@ def check(buildmeta) { } } + // Store git commit shas associated with each source git url + def sourcegiturls = [:] + for (meta in allmeta.metacollection) { + def String key = meta.gitinfo.remoteurl + + if (key) { + if (!sourcegiturls.containsKey(key)) { + sourcegiturls[key] = [:] + } + def commitsha = meta.gitinfo.gitrevision + if (!sourcegiturls[key].containsKey(commitsha)) { + sourcegiturls[key][commitsha] = 1 + } else { + sourcegiturls[key][commitsha] += 1 + } + } + } + + // Show what was collected + echo prettyPrint(toJson(sourcegiturls)) + + // Look for source git urls associated with more than one sha code + for (sgu in sourcegiturls.keySet()) { + def cs = sourcegiturls[sgu] + if (cs.size() > 1) { + results.good = false + results.comment += "There is more than one source commit sha associated with a source git url: ${sgu} being used in this build:\n" + for (c in cs.keySet()) { + results.comment += "${c}\n" + } + } + } + return results } From 037f00fab6233f83e189a2977f0ed4328ba20117 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 16 Nov 2021 17:40:47 +0000 Subject: [PATCH 075/153] Add a JSON object passing mechanism --- hardware/sominfo.groovy | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 hardware/sominfo.groovy diff --git a/hardware/sominfo.groovy b/hardware/sominfo.groovy new file mode 100644 index 0000000..b5a9028 --- /dev/null +++ b/hardware/sominfo.groovy @@ -0,0 +1,22 @@ +def sominfo = null + +def String asJsonText() { + return writeJSON(returnText: true, json: sominfo, pretty: 1) +} + +def boolean isSet() { + return (sominfo != null) +} + +def set(String jsontext) { + sominfo = readJSON(text: jsontext) + + def som_support_json_text = writeJSON(returnText: true, json: sominfo, pretty: 1) + echo "Som support info:\n${asJsonText()}" +} + +def get() { + return sominfo +} + +return this \ No newline at end of file From 2f65f299fbab1b59500b60c4dd3559c371d12580 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 16 Nov 2021 17:50:25 +0000 Subject: [PATCH 076/153] Add a JSON object passing mechanism --- hardware/sominfo.groovy | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/hardware/sominfo.groovy b/hardware/sominfo.groovy index b5a9028..41f3656 100644 --- a/hardware/sominfo.groovy +++ b/hardware/sominfo.groovy @@ -1,22 +1,22 @@ -def sominfo = null +def sominfostore = null def String asJsonText() { - return writeJSON(returnText: true, json: sominfo, pretty: 1) + return writeJSON(returnText: true, json: sominfostore, pretty: 1) } def boolean isSet() { - return (sominfo != null) + return (sominfostore != null) } def set(String jsontext) { - sominfo = readJSON(text: jsontext) + sominfostore = readJSON(text: jsontext) - def som_support_json_text = writeJSON(returnText: true, json: sominfo, pretty: 1) + def som_support_json_text = writeJSON(returnText: true, json: sominfostore, pretty: 1) echo "Som support info:\n${asJsonText()}" } def get() { - return sominfo + return sominfostore } return this \ No newline at end of file From ba2fa8cd05d006dac2314af53cf67eb64edffef5 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 16 Nov 2021 23:09:30 +0000 Subject: [PATCH 077/153] Add a JSON object passing mechanism --- hardware/sominfo.groovy | 62 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 61 insertions(+), 1 deletion(-) diff --git a/hardware/sominfo.groovy b/hardware/sominfo.groovy index 41f3656..fa745d1 100644 --- a/hardware/sominfo.groovy +++ b/hardware/sominfo.groovy @@ -1,10 +1,35 @@ def sominfostore = null +/* Example expected JSON +{ + "SomType": { + "Som_BA4": { + "Artifact info": { + "Location": "Jenkins job artifact", + "Job": "HMB_FD_HV_0.9.6/0.9.6_SG1024_EL_syn_ba4", + "Job selector": "true", + "Release repo": "git@hydra:hmb_fd_hv-releases/sg1024/hmb_fd_hv_logic_ba4.git", + "Release repo revision": "" + } + }, + "Som_FC5": { + "Artifact info": { + "Location": "Jenkins job artifact", + "Job": "HMB_FD_HV_0.9.6/0.9.6_SG1024_EL_syn_fc5", + "Job selector": "true", + "Release repo": "git@hydra:hmb_fd_hv-releases/sg1024/hmb_fd_hv_logic_fc5.git", + "Release repo revision": "" + } + } + } +} +*/ + def String asJsonText() { return writeJSON(returnText: true, json: sominfostore, pretty: 1) } -def boolean isSet() { +def boolean exists() { return (sominfostore != null) } @@ -19,4 +44,39 @@ def get() { return sominfostore } +def somtypes() { + return sominfostore['SomType'] +} + +def artifactinfo(somtype) { + return somtype['Artifact info'] +} + +def artifactlocation(artifactinfo) { + return artifactinfo['Location'] +} + +def boolean isjoblocation(artifactinfo) { + return (artifactinfo['Location'] == 'Jenkins job artifact' || + artifactinfo['Location'] == 'Jenkins job artefact') +} + +def boolean isreleaserepolocation(artifactinfo) { + return artifactinfo['Location'] == 'Release repository' +} + +def artifactjob(artifactinfo) { + return [ + "name": artifactinfo['Job'], + "selector": "${artifactinfo['Job selector']}" + ] +} + +def releaserepo(artifactinfo) { + return [ + "repo": artifactinfo['Release repo'], + "revision": artifactinfo['Release repo revision'] + ] +} + return this \ No newline at end of file From 535076b3e3dc1a4d609ca3337ac517e79c938ff9 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Wed, 17 Nov 2021 18:32:55 +0000 Subject: [PATCH 078/153] Add use of post build info json --- build/postactions.groovy | 164 ++++++++++++++++++++--------------- build/postactionstest.groovy | 36 ++++++++ hardware/sominfo.groovy | 2 - 3 files changed, 129 insertions(+), 73 deletions(-) create mode 100644 build/postactionstest.groovy diff --git a/build/postactions.groovy b/build/postactions.groovy index 90fcc15..c9b9a81 100644 --- a/build/postactions.groovy +++ b/build/postactions.groovy @@ -1,79 +1,101 @@ +/* Example post build info +{ + "Build outcomes": { + "Success": { + "Actions": { + "Deploy doxygen": { + "Description": "Can be empty - Name of doxygen deploy job to run if this build is successful", + "Job": "HMB_FD_HV_0.9.6/HMB_FD_HV_0.9.6_sg1024_doxygen_deploy" + }, + "Static analysis": { + "Description": "Can be empty - Static analysis job to run when this build is successful", + "Job": "" + }, + "Unit test": { + "Description": "Can be empty - Unit test job to run when this build is successful", + "Job": "" + }, + "Regression test": { + "Description": "Can be empty - Regression test job to run when this build is successful", + "Job": "HMB_FD_HV_0.9.6/HMB_FD_HV_0.9.6_sg1024_run_tests" + }, + "Update differences": { + "Description": "Can be empty - Update differences job to run when this build is successful", + "Job": "HMB_FD_HV_diff_releases" + }, + "Release to git": { + "Description": "Can be empty - Name of release to git job to run if this build is successful", + "Job": "HMB_FD_HV_release_to_git" + } + } + } + } +} +*/ -def performSuccessfulBuildActions() { - def String buildselector = "${BUILD_NUMBER}" - if (params.DOXYGEN_DEPLOY_JOB != null) { - if (DOXYGEN_DEPLOY_JOB && Jenkins.instance.getItemByFullName(DOXYGEN_DEPLOY_JOB).isBuildable()) { - build( - wait: false, - job: DOXYGEN_DEPLOY_JOB, - parameters: [ - string(name: 'BUILD_JOB_WITH_DOXYGEN_ARTIFACTS', value: JOB_NAME), - string(name: 'BUILD_JOB_WITH_DOXYGEN_ARTIFACTS_SELECTOR', value: buildselector), - ] - ) - } +def getActionJobName(postbuildactions, String action, String alternativeparamname) { + def String jobname + if (postbuildactions) { + jobname = postbuildactions[action]['Job'] + } else { + if (params[alternativeparam] != null) { + if (params[alternativeparam]) { + jobname = params[alternativeparam] + } + } } - if (params.STATIC_ANALYSIS_JOB != null) { - if (STATIC_ANALYSIS_JOB && Jenkins.instance.getItemByFullName(STATIC_ANALYSIS_JOB).isBuildable()) { - build( - wait: false, - job: STATIC_ANALYSIS_JOB, - parameters: [ - string(name: 'APPLICATION_ARTIFACT_PROJECT', value: JOB_NAME), - string(name: 'APPLICATION_ARTIFACT_SELECTOR', value: buildselector), - ] - ) + def jobitem = Jenkins.instance.getItemByFullName(jobname) + if (jobitem) { + if (!jobitem.isBuildable()) { + jobname = '' } + } else { + jobname = '' } - if (params.UNIT_TEST_JOB != null) { - if (UNIT_TEST_JOB && Jenkins.instance.getItemByFullName(UNIT_TEST_JOB).isBuildable()) { - build( - wait: false, - job: UNIT_TEST_JOB, - parameters: [ - string(name: 'APPLICATION_ARTIFACT_PROJECT', value: JOB_NAME), - string(name: 'APPLICATION_ARTIFACT_SELECTOR', value: buildselector), - ] - ) - } - } - if (params.REGRESSION_TEST_JOB != null) { - if (REGRESSION_TEST_JOB && Jenkins.instance.getItemByFullName(REGRESSION_TEST_JOB).isBuildable()) { - build( - wait: false, - job: REGRESSION_TEST_JOB, - parameters: [ - string(name: 'APPLICATION_ARTIFACT_PROJECT', value: JOB_NAME), - string(name: 'APPLICATION_ARTIFACT_SELECTOR', value: buildselector), - ] - ) - } - } - if (params.DIFF_JOB != null) { - if (DIFF_JOB && Jenkins.instance.getItemByFullName(DIFF_JOB).isBuildable()) { - build( - wait: false, - job: DIFF_JOB, - parameters: [ - string(name: 'LATER_SOURCE', value: 'Jenkins job artifact'), - string(name: 'LATER_BUILD_JOB', value: JOB_NAME), - string(name: 'LATER_BUILD_SELECTOR', value: buildselector), - ] - ) - } - } - if (params.RELEASE_TO_GIT_JOB != null) { - if (RELEASE_TO_GIT_JOB && Jenkins.instance.getItemByFullName(RELEASE_TO_GIT_JOB).isBuildable()) { - build( - wait: false, - job: RELEASE_TO_GIT_JOB, - parameters: [ - string(name: 'BUILD_JOB', value: JOB_NAME), - string(name: 'BUILD_JOB_SELECTOR', value: buildselector), - ] - ) - } + return jobname +} + + +def deployjob(String buildselector, postbuildactions, String action, String alternativeparamname) { + 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 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), + ] + ) } } + + +def performSuccessfulBuildActions() { + def postbuildactions + if (params.POST_BUILD_INFO != null) { + def postbuildinfo = readJSON(text: POST_BUILD_INFO) + def postbuildjsontext = writeJSON(returnText: true, json: postbuildinfo, pretty: 1) + echo "Post build info:\n${postbuildjsontext}" + postbuildactions = postbuildinfo['Build outcomes']['Success']['Action'] + postbuildinfoavailable = true + } + def String buildselector = "${BUILD_NUMBER}" + deployjob(buildselector, postbuildactions, 'Deploy doxygen', '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') +} + return this; diff --git a/build/postactionstest.groovy b/build/postactionstest.groovy new file mode 100644 index 0000000..553fcec --- /dev/null +++ b/build/postactionstest.groovy @@ -0,0 +1,36 @@ +pipeline { + agent { label AGENT_LABEL } + stages { + stage('Initial setup') { + steps { + script { + meta = load("${WORKSPACE}/autobuild/Common_scripts/autobuilder.groovy").startnonbuild(this) + } + } + } + stage('Dummy build job') { + steps { + script { + echo "Execute dummy build job" + } + } + } + } + post { + always { + echo 'Post-build' + } + failure { + echo 'Failed build' + } + unstable { + echo 'Unstable build' + } + success { + echo 'Succeeded build' + script { + load("${autobuilder.commonscripts()}/build/postactions.groovy").performSuccessfulBuildActions() + } + } + } +} diff --git a/hardware/sominfo.groovy b/hardware/sominfo.groovy index fa745d1..72a3ca9 100644 --- a/hardware/sominfo.groovy +++ b/hardware/sominfo.groovy @@ -35,8 +35,6 @@ def boolean exists() { def set(String jsontext) { sominfostore = readJSON(text: jsontext) - - def som_support_json_text = writeJSON(returnText: true, json: sominfostore, pretty: 1) echo "Som support info:\n${asJsonText()}" } From 2cbe8f345a5d459454afc5dd6c4c02a9f1b528eb Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Wed, 17 Nov 2021 18:39:38 +0000 Subject: [PATCH 079/153] Add use of post build info json --- build/postactionstest.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/postactionstest.groovy b/build/postactionstest.groovy index 553fcec..63d1bd1 100644 --- a/build/postactionstest.groovy +++ b/build/postactionstest.groovy @@ -1,5 +1,5 @@ pipeline { - agent { label AGENT_LABEL } + agent { label master } stages { stage('Initial setup') { steps { From e90a2174561a46eb75c8777a3151a3f210bde2c7 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Wed, 17 Nov 2021 18:40:14 +0000 Subject: [PATCH 080/153] Add use of post build info json --- build/postactionstest.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/postactionstest.groovy b/build/postactionstest.groovy index 63d1bd1..f691d40 100644 --- a/build/postactionstest.groovy +++ b/build/postactionstest.groovy @@ -1,5 +1,5 @@ pipeline { - agent { label master } + agent { label 'master' } stages { stage('Initial setup') { steps { From 458d9605fedd04cb441dd4fd8a7adb7651f02d63 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Wed, 17 Nov 2021 18:42:44 +0000 Subject: [PATCH 081/153] Add use of post build info json --- build/postactionstest.groovy | 1 + 1 file changed, 1 insertion(+) diff --git a/build/postactionstest.groovy b/build/postactionstest.groovy index f691d40..f155b94 100644 --- a/build/postactionstest.groovy +++ b/build/postactionstest.groovy @@ -4,6 +4,7 @@ pipeline { stage('Initial setup') { steps { script { + CLEAN_WORKSPACE = false meta = load("${WORKSPACE}/autobuild/Common_scripts/autobuilder.groovy").startnonbuild(this) } } From fa3340487dd6fe31403407f8f84e8b4b32e4ef20 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Wed, 17 Nov 2021 18:46:40 +0000 Subject: [PATCH 082/153] Add use of post build info json --- build/postactions.groovy | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build/postactions.groovy b/build/postactions.groovy index c9b9a81..8a876de 100644 --- a/build/postactions.groovy +++ b/build/postactions.groovy @@ -38,9 +38,9 @@ def getActionJobName(postbuildactions, String action, String alternativeparamnam if (postbuildactions) { jobname = postbuildactions[action]['Job'] } else { - if (params[alternativeparam] != null) { - if (params[alternativeparam]) { - jobname = params[alternativeparam] + if (params[alternativeparamname] != null) { + if (params[alternativeparamname]) { + jobname = params[alternativeparamname] } } } From 951d6940513a04c1a5dc60ab83ba7a48a644d49d Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Wed, 17 Nov 2021 21:25:47 +0000 Subject: [PATCH 083/153] Add use of post build info json --- build/postactions.groovy | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/build/postactions.groovy b/build/postactions.groovy index 8a876de..fbc71a4 100644 --- a/build/postactions.groovy +++ b/build/postactions.groovy @@ -44,13 +44,15 @@ def getActionJobName(postbuildactions, String action, String alternativeparamnam } } } - def jobitem = Jenkins.instance.getItemByFullName(jobname) - if (jobitem) { - if (!jobitem.isBuildable()) { + if (!jobname) { + def jobitem = Jenkins.instance.getItemByFullName(jobname) + if (jobitem) { + if (!jobitem.isBuildable()) { + jobname = '' + } + } else { jobname = '' } - } else { - jobname = '' } return jobname } @@ -86,7 +88,7 @@ def performSuccessfulBuildActions() { def postbuildinfo = readJSON(text: POST_BUILD_INFO) def postbuildjsontext = writeJSON(returnText: true, json: postbuildinfo, pretty: 1) echo "Post build info:\n${postbuildjsontext}" - postbuildactions = postbuildinfo['Build outcomes']['Success']['Action'] + postbuildactions = postbuildinfo['Build outcomes']['Success']['Actions'] postbuildinfoavailable = true } def String buildselector = "${BUILD_NUMBER}" From a5b06d79a9f514b642887f86f545f5d3737facfe Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Wed, 17 Nov 2021 21:41:53 +0000 Subject: [PATCH 084/153] Add use of post build info json --- build/postactions.groovy | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/build/postactions.groovy b/build/postactions.groovy index fbc71a4..0092f44 100644 --- a/build/postactions.groovy +++ b/build/postactions.groovy @@ -34,9 +34,13 @@ */ def getActionJobName(postbuildactions, String action, String alternativeparamname) { - def String jobname + def String jobname = '' if (postbuildactions) { - jobname = postbuildactions[action]['Job'] + try { + jobname = postbuildactions[action]['Job'] + } catch(Exception ex) { + jobname = '' + } } else { if (params[alternativeparamname] != null) { if (params[alternativeparamname]) { From ec8ad9095325e46ae2d5dab9446d9d0aa32872d4 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Wed, 17 Nov 2021 21:47:57 +0000 Subject: [PATCH 085/153] Add use of post build info json --- build/postactions.groovy | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/build/postactions.groovy b/build/postactions.groovy index 0092f44..b5662c7 100644 --- a/build/postactions.groovy +++ b/build/postactions.groovy @@ -92,8 +92,13 @@ def performSuccessfulBuildActions() { def postbuildinfo = readJSON(text: POST_BUILD_INFO) def postbuildjsontext = writeJSON(returnText: true, json: postbuildinfo, pretty: 1) echo "Post build info:\n${postbuildjsontext}" - postbuildactions = postbuildinfo['Build outcomes']['Success']['Actions'] - postbuildinfoavailable = true + try { + postbuildactions = postbuildinfo['Build outcomes']['Success']['Actions'] + postbuildinfoavailable = true + } catch(Exception ex) { + postbuildinfoavailable = false + postbuildactions = null + } } def String buildselector = "${BUILD_NUMBER}" deployjob(buildselector, postbuildactions, 'Deploy doxygen', 'DOXYGEN_DEPLOY_JOB') From dc894e9d280726cf9891ccd56418d1f669ea9c53 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Wed, 17 Nov 2021 21:52:35 +0000 Subject: [PATCH 086/153] Add use of post build info json --- build/postactions.groovy | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build/postactions.groovy b/build/postactions.groovy index b5662c7..728765f 100644 --- a/build/postactions.groovy +++ b/build/postactions.groovy @@ -39,6 +39,7 @@ def getActionJobName(postbuildactions, String action, String alternativeparamnam try { jobname = postbuildactions[action]['Job'] } catch(Exception ex) { + echo "No post build actions found for action: ${action}" jobname = '' } } else { @@ -58,6 +59,7 @@ def getActionJobName(postbuildactions, String action, String alternativeparamnam jobname = '' } } + echo "Job name for action: ${action}: ${jobname}" return jobname } @@ -96,6 +98,7 @@ def performSuccessfulBuildActions() { postbuildactions = postbuildinfo['Build outcomes']['Success']['Actions'] postbuildinfoavailable = true } catch(Exception ex) { + echo "Post build info did not contain: Build outcomes/Success/Actions" postbuildinfoavailable = false postbuildactions = null } From 0486d41096026d0a5ce08903e5e66b828a329794 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Wed, 17 Nov 2021 22:00:24 +0000 Subject: [PATCH 087/153] Add use of post build info json --- build/postactions.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/postactions.groovy b/build/postactions.groovy index 728765f..0895d27 100644 --- a/build/postactions.groovy +++ b/build/postactions.groovy @@ -49,7 +49,7 @@ def getActionJobName(postbuildactions, String action, String alternativeparamnam } } } - if (!jobname) { + if (jobname) { def jobitem = Jenkins.instance.getItemByFullName(jobname) if (jobitem) { if (!jobitem.isBuildable()) { From 0aeadaaed2a556504d8419511eae39e1d08eefb8 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Wed, 17 Nov 2021 22:08:44 +0000 Subject: [PATCH 088/153] Add use of post build info json --- build/postactions.groovy | 3 --- 1 file changed, 3 deletions(-) diff --git a/build/postactions.groovy b/build/postactions.groovy index 0895d27..2e91b04 100644 --- a/build/postactions.groovy +++ b/build/postactions.groovy @@ -63,7 +63,6 @@ def getActionJobName(postbuildactions, String action, String alternativeparamnam return jobname } - def deployjob(String buildselector, postbuildactions, String action, String alternativeparamname) { def jobname = getActionJobName(postbuildactions, action, alternativeparamname) if (jobname) { @@ -86,8 +85,6 @@ def deployjob(String buildselector, postbuildactions, String action, String alte } } - - def performSuccessfulBuildActions() { def postbuildactions if (params.POST_BUILD_INFO != null) { From 3f5001a7c2cf4cf33cae47a447a4e829213b457c Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Wed, 17 Nov 2021 22:12:03 +0000 Subject: [PATCH 089/153] Add use of post build info json --- build/postactions.groovy | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build/postactions.groovy b/build/postactions.groovy index 2e91b04..fbf98b6 100644 --- a/build/postactions.groovy +++ b/build/postactions.groovy @@ -73,6 +73,9 @@ def deployjob(String buildselector, postbuildactions, String action, String alte // 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), From 607232dd23f5924d221e0851993a45f76eaa7936 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Fri, 19 Nov 2021 23:45:34 +0000 Subject: [PATCH 090/153] Add failed build action --- build/postactions.groovy | 109 ++++++++++++++++++++++++++++----------- 1 file changed, 79 insertions(+), 30 deletions(-) diff --git a/build/postactions.groovy b/build/postactions.groovy index fbf98b6..ac5eabd 100644 --- a/build/postactions.groovy +++ b/build/postactions.groovy @@ -1,35 +1,45 @@ /* Example post build info { - "Build outcomes": { - "Success": { - "Actions": { - "Deploy doxygen": { - "Description": "Can be empty - Name of doxygen deploy job to run if this build is successful", - "Job": "HMB_FD_HV_0.9.6/HMB_FD_HV_0.9.6_sg1024_doxygen_deploy" + "Build outcomes": { + "Success": { + "Actions": { + "Deploy doxygen": { + "Description": "Can be empty - Name of doxygen deploy job to run if this build is successful", + "Job": "HMB_FD_HV_0.9.6/HMB_FD_HV_0.9.6_sg1024_doxygen_deploy" + }, + "Static analysis": { + "Description": "Can be empty - Static analysis job to run when this build is successful", + "Job": "" + }, + "Unit test": { + "Description": "Can be empty - Unit test job to run when this build is successful", + "Job": "" + }, + "Regression test": { + "Description": "Can be empty - Regression test job to run when this build is successful", + "Job": "HMB_FD_HV_0.9.6/HMB_FD_HV_0.9.6_sg1024_run_tests" + }, + "Update differences": { + "Description": "Can be empty - Update differences job to run when this build is successful", + "Job": "HMB_FD_HV_diff_releases" + }, + "Release to git": { + "Description": "Can be empty - Name of release to git job to run if this build is successful", + "Job": "HMB_FD_HV_release_to_git" + } + } }, - "Static analysis": { - "Description": "Can be empty - Static analysis job to run when this build is successful", - "Job": "" - }, - "Unit test": { - "Description": "Can be empty - Unit test job to run when this build is successful", - "Job": "" - }, - "Regression test": { - "Description": "Can be empty - Regression test job to run when this build is successful", - "Job": "HMB_FD_HV_0.9.6/HMB_FD_HV_0.9.6_sg1024_run_tests" - }, - "Update differences": { - "Description": "Can be empty - Update differences job to run when this build is successful", - "Job": "HMB_FD_HV_diff_releases" - }, - "Release to git": { - "Description": "Can be empty - Name of release to git job to run if this build is successful", - "Job": "HMB_FD_HV_release_to_git" + "Failed": { + "Actions": { + "Email": { + "Description": "Can be empty - Name of release to git job to run if this build is successful", + "To": [ + "dan.hawkins@globalinkjetsystems.com" + ] + } + } } - } } - } } */ @@ -88,12 +98,18 @@ def deployjob(String buildselector, postbuildactions, String action, String alte } } +def readPostBuildInfo() { + def postbuildinfo = readJSON(text: POST_BUILD_INFO) + def postbuildjsontext = writeJSON(returnText: true, json: postbuildinfo, pretty: 1) + echo "Post build info:\n${postbuildjsontext}" + + return postbuildinfo +} + def performSuccessfulBuildActions() { def postbuildactions if (params.POST_BUILD_INFO != null) { - def postbuildinfo = readJSON(text: POST_BUILD_INFO) - def postbuildjsontext = writeJSON(returnText: true, json: postbuildinfo, pretty: 1) - echo "Post build info:\n${postbuildjsontext}" + def postbuildinfo = readPostBuildInfo() try { postbuildactions = postbuildinfo['Build outcomes']['Success']['Actions'] postbuildinfoavailable = true @@ -112,4 +128,37 @@ def performSuccessfulBuildActions() { deployjob(buildselector, postbuildactions, 'Release to git', 'RELEASE_TO_GIT_JOB') } +def sendemails(emailtolist) { + def emailbody = """ + Failed build: ${JOBNAME} ${BUILD_DISPLAY_NAME} : ${BUILD_URL} + """ + + for(emailto in emailtolist) { + mail( + subject: "Failed build: ${JOBNAME} ${BUILD_DISPLAY_NAME}", + body: emailbody, + to: emailto + ) + } +} + +def performFailedBuildActions() { + def postbuildactions = null + if (params.POST_BUILD_INFO != null) { + def postbuildinfo = readPostBuildInfo() + try { + postbuildactions = postbuildinfo['Build outcomes']['Failed']['Actions'] + } catch(Exception ex) { + echo "Post build info did not contain: Build outcomes/Failed/Actions" + postbuildactions = null + } + } + if (postbuildactions) { + def emailtolist = postbuildactions['Email']['To'] + if (emailtolist) { + sendemails(emailtolist) + } + } +} + return this; From 8b0c194b4771bf3cdac5414f2e623cf0e2bdefd2 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Fri, 19 Nov 2021 23:45:49 +0000 Subject: [PATCH 091/153] Add failed build action --- build/postactions.groovy | 2 -- 1 file changed, 2 deletions(-) diff --git a/build/postactions.groovy b/build/postactions.groovy index ac5eabd..c5cc90c 100644 --- a/build/postactions.groovy +++ b/build/postactions.groovy @@ -112,10 +112,8 @@ def performSuccessfulBuildActions() { def postbuildinfo = readPostBuildInfo() try { postbuildactions = postbuildinfo['Build outcomes']['Success']['Actions'] - postbuildinfoavailable = true } catch(Exception ex) { echo "Post build info did not contain: Build outcomes/Success/Actions" - postbuildinfoavailable = false postbuildactions = null } } From 1b4e670855cb857491b351c792e86075452163bf Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Fri, 19 Nov 2021 23:48:28 +0000 Subject: [PATCH 092/153] Add failed build action --- build/postactionstest.groovy | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/build/postactionstest.groovy b/build/postactionstest.groovy index f155b94..885bc25 100644 --- a/build/postactionstest.groovy +++ b/build/postactionstest.groovy @@ -13,6 +13,9 @@ pipeline { steps { script { echo "Execute dummy build job" + if (CAUSE_ERROR) { + error("Causing error") + } } } } @@ -23,6 +26,9 @@ pipeline { } failure { echo 'Failed build' + script { + load("${autobuilder.commonscripts()}/build/postactions.groovy").performFailedBuildActions() + } } unstable { echo 'Unstable build' From 12c6b71a8ffe0d7ddb449900ee3dd25e9907feec Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Fri, 19 Nov 2021 23:55:48 +0000 Subject: [PATCH 093/153] Add failed build action --- build/postactions.groovy | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build/postactions.groovy b/build/postactions.groovy index c5cc90c..3007acf 100644 --- a/build/postactions.groovy +++ b/build/postactions.groovy @@ -128,12 +128,12 @@ def performSuccessfulBuildActions() { def sendemails(emailtolist) { def emailbody = """ - Failed build: ${JOBNAME} ${BUILD_DISPLAY_NAME} : ${BUILD_URL} + Failed build: ${JOB_NAME} ${BUILD_DISPLAY_NAME} : ${BUILD_URL} """ for(emailto in emailtolist) { mail( - subject: "Failed build: ${JOBNAME} ${BUILD_DISPLAY_NAME}", + subject: "Failed build: ${JOB_NAME} ${BUILD_DISPLAY_NAME}", body: emailbody, to: emailto ) From 1a67b16fcdf870fe710081d4b08d02f994a972a9 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sat, 20 Nov 2021 00:00:01 +0000 Subject: [PATCH 094/153] Add failed build action --- build/postactions.groovy | 1 + 1 file changed, 1 insertion(+) diff --git a/build/postactions.groovy b/build/postactions.groovy index 3007acf..73c8f43 100644 --- a/build/postactions.groovy +++ b/build/postactions.groovy @@ -153,6 +153,7 @@ def performFailedBuildActions() { } if (postbuildactions) { def emailtolist = postbuildactions['Email']['To'] + echo "emailtolist: ${emailtolist}" if (emailtolist) { sendemails(emailtolist) } From 3b9ba8bfcdb5ea0f7cb1460de48700dcfa69e20c Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sat, 20 Nov 2021 00:03:08 +0000 Subject: [PATCH 095/153] Add failed build action --- build/postactions.groovy | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/build/postactions.groovy b/build/postactions.groovy index 73c8f43..773ae7e 100644 --- a/build/postactions.groovy +++ b/build/postactions.groovy @@ -129,7 +129,9 @@ def performSuccessfulBuildActions() { def sendemails(emailtolist) { def emailbody = """ Failed build: ${JOB_NAME} ${BUILD_DISPLAY_NAME} : ${BUILD_URL} - """ + + Console output: ${BUILD_URL}/console +""" for(emailto in emailtolist) { mail( @@ -137,6 +139,7 @@ def sendemails(emailtolist) { body: emailbody, to: emailto ) + echo "Send email to: ${emailto}" } } @@ -153,7 +156,6 @@ def performFailedBuildActions() { } if (postbuildactions) { def emailtolist = postbuildactions['Email']['To'] - echo "emailtolist: ${emailtolist}" if (emailtolist) { sendemails(emailtolist) } From 0ec730804cd5b1eec42beea93d3d1a0b8ad17883 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sat, 20 Nov 2021 00:04:02 +0000 Subject: [PATCH 096/153] Add failed build action --- build/postactions.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/postactions.groovy b/build/postactions.groovy index 773ae7e..6503e1b 100644 --- a/build/postactions.groovy +++ b/build/postactions.groovy @@ -130,7 +130,7 @@ def sendemails(emailtolist) { def emailbody = """ Failed build: ${JOB_NAME} ${BUILD_DISPLAY_NAME} : ${BUILD_URL} - Console output: ${BUILD_URL}/console + Console output: ${BUILD_URL}console """ for(emailto in emailtolist) { From ee1ad67d5cf3e3e8c9a8ccfebc7fba7e0e4f11fb Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sat, 20 Nov 2021 00:10:25 +0000 Subject: [PATCH 097/153] Add failed build action --- build/postactions.groovy | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/build/postactions.groovy b/build/postactions.groovy index 6503e1b..e789d97 100644 --- a/build/postactions.groovy +++ b/build/postactions.groovy @@ -131,6 +131,18 @@ def sendemails(emailtolist) { Failed build: ${JOB_NAME} ${BUILD_DISPLAY_NAME} : ${BUILD_URL} Console output: ${BUILD_URL}console + + ${GIT_COMMIT} + ${GIT_PREVIOUS_COMMIT} + ${GIT_PREVIOUS_SUCCESSFUL_COMMIT} + ${GIT_BRANCH} + ${GIT_LOCAL_BRANCH} + ${GIT_CHECKOUT_DIR} + ${GIT_URL} + ${GIT_COMMITTER_NAME} + ${GIT_AUTHOR_NAME} + ${GIT_COMMITTER_EMAIL} + ${GIT_AUTHOR_EMAIL} """ for(emailto in emailtolist) { From 1ad79a3443cc2a3d653210b2c2191307f9db2f57 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sat, 20 Nov 2021 00:11:49 +0000 Subject: [PATCH 098/153] Add failed build action --- build/postactions.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/postactions.groovy b/build/postactions.groovy index e789d97..6033328 100644 --- a/build/postactions.groovy +++ b/build/postactions.groovy @@ -136,7 +136,7 @@ def sendemails(emailtolist) { ${GIT_PREVIOUS_COMMIT} ${GIT_PREVIOUS_SUCCESSFUL_COMMIT} ${GIT_BRANCH} - ${GIT_LOCAL_BRANCH} + no GIT_LOCAL_BRANCH ${GIT_CHECKOUT_DIR} ${GIT_URL} ${GIT_COMMITTER_NAME} From bb477a289d202e7f5238899e9c7c6c9262fb37e0 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sat, 20 Nov 2021 00:12:33 +0000 Subject: [PATCH 099/153] Add failed build action --- build/postactions.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/postactions.groovy b/build/postactions.groovy index 6033328..5c22a27 100644 --- a/build/postactions.groovy +++ b/build/postactions.groovy @@ -139,7 +139,7 @@ def sendemails(emailtolist) { no GIT_LOCAL_BRANCH ${GIT_CHECKOUT_DIR} ${GIT_URL} - ${GIT_COMMITTER_NAME} + no GIT_COMMITTER_NAME ${GIT_AUTHOR_NAME} ${GIT_COMMITTER_EMAIL} ${GIT_AUTHOR_EMAIL} From f7b0a223121058c58e09c6626a460877fd45371a Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sat, 20 Nov 2021 00:13:15 +0000 Subject: [PATCH 100/153] Add failed build action --- build/postactions.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/postactions.groovy b/build/postactions.groovy index 5c22a27..46e2f50 100644 --- a/build/postactions.groovy +++ b/build/postactions.groovy @@ -140,7 +140,7 @@ def sendemails(emailtolist) { ${GIT_CHECKOUT_DIR} ${GIT_URL} no GIT_COMMITTER_NAME - ${GIT_AUTHOR_NAME} + no GIT_AUTHOR_NAME ${GIT_COMMITTER_EMAIL} ${GIT_AUTHOR_EMAIL} """ From 61a519d406861bdda92c14c3e640f50622232e62 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sat, 20 Nov 2021 00:13:55 +0000 Subject: [PATCH 101/153] Add failed build action --- build/postactions.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/postactions.groovy b/build/postactions.groovy index 46e2f50..a03deb8 100644 --- a/build/postactions.groovy +++ b/build/postactions.groovy @@ -141,7 +141,7 @@ def sendemails(emailtolist) { ${GIT_URL} no GIT_COMMITTER_NAME no GIT_AUTHOR_NAME - ${GIT_COMMITTER_EMAIL} + no GIT_COMMITTER_EMAIL ${GIT_AUTHOR_EMAIL} """ From 33208a4a1e90cf646b978bcd810f79d1e833bb7e Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sat, 20 Nov 2021 00:14:33 +0000 Subject: [PATCH 102/153] Add failed build action --- build/postactions.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/postactions.groovy b/build/postactions.groovy index a03deb8..3aeff8f 100644 --- a/build/postactions.groovy +++ b/build/postactions.groovy @@ -142,7 +142,7 @@ def sendemails(emailtolist) { no GIT_COMMITTER_NAME no GIT_AUTHOR_NAME no GIT_COMMITTER_EMAIL - ${GIT_AUTHOR_EMAIL} + no GIT_AUTHOR_EMAIL """ for(emailto in emailtolist) { From c681874522bf7e121e88146458424ce078c4cb4b Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sat, 20 Nov 2021 00:17:07 +0000 Subject: [PATCH 103/153] Add failed build action --- build/postactions.groovy | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/build/postactions.groovy b/build/postactions.groovy index 3aeff8f..fb0fc93 100644 --- a/build/postactions.groovy +++ b/build/postactions.groovy @@ -132,6 +132,8 @@ def sendemails(emailtolist) { Console output: ${BUILD_URL}console +""" +/* ${GIT_COMMIT} ${GIT_PREVIOUS_COMMIT} ${GIT_PREVIOUS_SUCCESSFUL_COMMIT} @@ -143,8 +145,7 @@ def sendemails(emailtolist) { no GIT_AUTHOR_NAME no GIT_COMMITTER_EMAIL no GIT_AUTHOR_EMAIL -""" - +*/ for(emailto in emailtolist) { mail( subject: "Failed build: ${JOB_NAME} ${BUILD_DISPLAY_NAME}", From d7fae344ef13a1eb26ab5dfb47b1a02f5fbb413c Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sat, 20 Nov 2021 18:57:02 +0000 Subject: [PATCH 104/153] Use extended email to send emails on failed build --- build/postactions.groovy | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/build/postactions.groovy b/build/postactions.groovy index fb0fc93..dca6672 100644 --- a/build/postactions.groovy +++ b/build/postactions.groovy @@ -36,6 +36,9 @@ "To": [ "dan.hawkins@globalinkjetsystems.com" ] + }, + "ExtEmail": { + "Description": "Send an email using Extended Email plugin" } } } @@ -156,6 +159,26 @@ def sendemails(emailtolist) { } } +def sendextemail() { + emailext( + subject: "Failed build: ${JOB_NAME} ${BUILD_DISPLAY_NAME}", + body: """ + ${JELLY_SCRIPT,template="html"} + """, + attachLog: true, + attachmentsPattern: '', + compressLog: false, + // from : '', + // mimeType: '', + // postsendScript: '', + // presendScript: '', + recipientProviders: [culprits(), requestor(), developers()], // Could be: buildUser, culprits, developers, brokenTestsSuspects, brokenBuildSuspects, recipients, requestor, upstreamDevelopers + // replyTo: '', + // saveOutput: true, + // to: '', + ) +} + def performFailedBuildActions() { def postbuildactions = null if (params.POST_BUILD_INFO != null) { @@ -172,6 +195,9 @@ def performFailedBuildActions() { if (emailtolist) { sendemails(emailtolist) } + if (postbuildactions['ExtEmail']) { + sendextemail() + } } } From efa290011bf9e8c7fd366f76f50136c5cbd1a549 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sat, 20 Nov 2021 19:07:52 +0000 Subject: [PATCH 105/153] Use extended email to send emails on failed build --- build/postactions.groovy | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/build/postactions.groovy b/build/postactions.groovy index dca6672..8a880f2 100644 --- a/build/postactions.groovy +++ b/build/postactions.groovy @@ -151,7 +151,7 @@ def sendemails(emailtolist) { */ for(emailto in emailtolist) { mail( - subject: "Failed build: ${JOB_NAME} ${BUILD_DISPLAY_NAME}", + subject: "[Jenkins] Failed build: ${JOB_NAME} ${BUILD_DISPLAY_NAME}", body: emailbody, to: emailto ) @@ -161,15 +161,13 @@ def sendemails(emailtolist) { def sendextemail() { emailext( - subject: "Failed build: ${JOB_NAME} ${BUILD_DISPLAY_NAME}", - body: """ - ${JELLY_SCRIPT,template="html"} - """, + subject: "[Jenkins] Failed build: ${JOB_NAME} ${BUILD_DISPLAY_NAME}", + body: '''${JELLY_SCRIPT,template="html"}''', attachLog: true, attachmentsPattern: '', compressLog: false, // from : '', - // mimeType: '', + mimeType: 'text/html', // postsendScript: '', // presendScript: '', recipientProviders: [culprits(), requestor(), developers()], // Could be: buildUser, culprits, developers, brokenTestsSuspects, brokenBuildSuspects, recipients, requestor, upstreamDevelopers From ece760f599ad96fb5af48302cca267b2a2e13be4 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sat, 20 Nov 2021 19:10:45 +0000 Subject: [PATCH 106/153] Use extended email to send emails on failed build --- build/postactions.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/postactions.groovy b/build/postactions.groovy index 8a880f2..4314efe 100644 --- a/build/postactions.groovy +++ b/build/postactions.groovy @@ -173,7 +173,7 @@ def sendextemail() { recipientProviders: [culprits(), requestor(), developers()], // Could be: buildUser, culprits, developers, brokenTestsSuspects, brokenBuildSuspects, recipients, requestor, upstreamDevelopers // replyTo: '', // saveOutput: true, - // to: '', + to: 'dan.hawkins@globalinkjetsystems.com', ) } From 0469b404b190e5d0c92feb6d796bd2e04e4a59a8 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sat, 20 Nov 2021 20:34:47 +0000 Subject: [PATCH 107/153] Use extended email to send emails on failed build --- build/postactions.groovy | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build/postactions.groovy b/build/postactions.groovy index 4314efe..3bcb29d 100644 --- a/build/postactions.groovy +++ b/build/postactions.groovy @@ -164,15 +164,15 @@ def sendextemail() { subject: "[Jenkins] Failed build: ${JOB_NAME} ${BUILD_DISPLAY_NAME}", body: '''${JELLY_SCRIPT,template="html"}''', attachLog: true, - attachmentsPattern: '', + // attachmentsPattern: '', compressLog: false, // from : '', mimeType: 'text/html', // postsendScript: '', // presendScript: '', - recipientProviders: [culprits(), requestor(), developers()], // Could be: buildUser, culprits, developers, brokenTestsSuspects, brokenBuildSuspects, recipients, requestor, upstreamDevelopers + recipientProviders: [culprits(), requestor(), developers(), upstreamDevelopers()], // Could be: buildUser, culprits, developers, brokenTestsSuspects, brokenBuildSuspects, recipients, requestor, upstreamDevelopers // replyTo: '', - // saveOutput: true, + saveOutput: false, to: 'dan.hawkins@globalinkjetsystems.com', ) } From 7cfd3f2eb89b84f3aa766f462c0349a6b8a476d7 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sat, 20 Nov 2021 21:11:14 +0000 Subject: [PATCH 108/153] Use extended email to send emails on failed build --- build/postactions.groovy | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/build/postactions.groovy b/build/postactions.groovy index 3bcb29d..eaa63b4 100644 --- a/build/postactions.groovy +++ b/build/postactions.groovy @@ -3,8 +3,8 @@ "Build outcomes": { "Success": { "Actions": { - "Deploy doxygen": { - "Description": "Can be empty - Name of doxygen deploy job to run if this build is successful", + "Deploy documentation": { + "Description": "Can be empty - Name of documentation/doxygen deploy job to run if this build is successful", "Job": "HMB_FD_HV_0.9.6/HMB_FD_HV_0.9.6_sg1024_doxygen_deploy" }, "Static analysis": { @@ -121,7 +121,7 @@ def performSuccessfulBuildActions() { } } def String buildselector = "${BUILD_NUMBER}" - deployjob(buildselector, postbuildactions, 'Deploy doxygen', 'DOXYGEN_DEPLOY_JOB') + 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') @@ -134,21 +134,7 @@ def sendemails(emailtolist) { Failed build: ${JOB_NAME} ${BUILD_DISPLAY_NAME} : ${BUILD_URL} Console output: ${BUILD_URL}console - -""" -/* - ${GIT_COMMIT} - ${GIT_PREVIOUS_COMMIT} - ${GIT_PREVIOUS_SUCCESSFUL_COMMIT} - ${GIT_BRANCH} - no GIT_LOCAL_BRANCH - ${GIT_CHECKOUT_DIR} - ${GIT_URL} - no GIT_COMMITTER_NAME - no GIT_AUTHOR_NAME - no GIT_COMMITTER_EMAIL - no GIT_AUTHOR_EMAIL -*/ + """ for(emailto in emailtolist) { mail( subject: "[Jenkins] Failed build: ${JOB_NAME} ${BUILD_DISPLAY_NAME}", From 1bf41f1af00de121885c0511aa4b462d08462228 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sat, 20 Nov 2021 21:15:57 +0000 Subject: [PATCH 109/153] Use extended email to send emails on failed build --- build/postactionstest.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/postactionstest.groovy b/build/postactionstest.groovy index 885bc25..62f5cd4 100644 --- a/build/postactionstest.groovy +++ b/build/postactionstest.groovy @@ -12,7 +12,7 @@ pipeline { stage('Dummy build job') { steps { script { - echo "Execute dummy build job" + echo "Execute dummy build job: ${CAUSE_ERROR}" if (CAUSE_ERROR) { error("Causing error") } From f41825d4b4a30037be8ffa1d834154884711ec70 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sat, 20 Nov 2021 21:17:53 +0000 Subject: [PATCH 110/153] Use extended email to send emails on failed build --- build/postactionstest.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/postactionstest.groovy b/build/postactionstest.groovy index 62f5cd4..e02d91f 100644 --- a/build/postactionstest.groovy +++ b/build/postactionstest.groovy @@ -13,7 +13,7 @@ pipeline { steps { script { echo "Execute dummy build job: ${CAUSE_ERROR}" - if (CAUSE_ERROR) { + if (CAUSE_ERROR == true) { error("Causing error") } } From 66ffedf35992435cab1d49ea368aa69b38b234c7 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sun, 21 Nov 2021 08:55:07 +0000 Subject: [PATCH 111/153] Use extended email to send emails on failed build --- build/postactions.groovy | 56 ++++++++++++++++++++++++++++++++++++---- 1 file changed, 51 insertions(+), 5 deletions(-) diff --git a/build/postactions.groovy b/build/postactions.groovy index eaa63b4..657f1e8 100644 --- a/build/postactions.groovy +++ b/build/postactions.groovy @@ -38,7 +38,16 @@ ] }, "ExtEmail": { - "Description": "Send an email using Extended Email plugin" + "Description": "Send an email using Extended Email plugin", + "To": [ + "dan.hawkins@globalinkjetsystems.com" + ], + "Recipient providers": [ + "culprits", + "requestor", + "developers", + "upstreamDevelopers" + ] } } } @@ -145,7 +154,44 @@ def sendemails(emailtolist) { } } -def sendextemail() { +def getRecipientProviders(recipientProviderInfo) { + def recipientProviders = [] + + if (recipientProviderInfo) { + def recipientProviderInfoList = recipientProviderInfo['Recipient providers'] + if (recipientProviderInfoList) { + for(rp in recipientProviderInfoList) { + if (rp == 'culprits') { + recipientProviders.append(culprits()) + } + if (rp == 'requestor') { + recipientProviders.append(requestor()) + } + if (rp == 'developers') { + recipientProviders.append(developers()) + } + if (rp == 'upstreamDevelopers') { + recipientProviders.append(upstreamDevelopers()) + } + } + } + } + return recipientProviders; +} + +def String getToList(toListInfo) { + def String toList + + if (toListInfo) { + toList = toListInfo.join(',') + } + return toList +} + +def sendextemail(extmailinfo) { + def recipientProviders = getRecipientProviders(extmailinfo['Recipient providers']) + def toList = getToList(extmailinfo['To']) + emailext( subject: "[Jenkins] Failed build: ${JOB_NAME} ${BUILD_DISPLAY_NAME}", body: '''${JELLY_SCRIPT,template="html"}''', @@ -156,10 +202,10 @@ def sendextemail() { mimeType: 'text/html', // postsendScript: '', // presendScript: '', - recipientProviders: [culprits(), requestor(), developers(), upstreamDevelopers()], // Could be: buildUser, culprits, developers, brokenTestsSuspects, brokenBuildSuspects, recipients, requestor, upstreamDevelopers + recipientProviders: recipientProviders, // Could be: buildUser, culprits, developers, brokenTestsSuspects, brokenBuildSuspects, recipients, requestor, upstreamDevelopers // replyTo: '', saveOutput: false, - to: 'dan.hawkins@globalinkjetsystems.com', + to: toList, ) } @@ -180,7 +226,7 @@ def performFailedBuildActions() { sendemails(emailtolist) } if (postbuildactions['ExtEmail']) { - sendextemail() + sendextemail(postbuildactions['ExtEmail']) } } } From 404cdef36b425cb8e196772d23976291a450e984 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sun, 21 Nov 2021 09:33:50 +0000 Subject: [PATCH 112/153] Use extended email to send emails on failed build --- build/postactionstest.groovy | 1 + 1 file changed, 1 insertion(+) diff --git a/build/postactionstest.groovy b/build/postactionstest.groovy index e02d91f..7db1fdc 100644 --- a/build/postactionstest.groovy +++ b/build/postactionstest.groovy @@ -12,6 +12,7 @@ pipeline { stage('Dummy build job') { steps { script { + echo "Params:\n${params.toString()}" echo "Execute dummy build job: ${CAUSE_ERROR}" if (CAUSE_ERROR == true) { error("Causing error") From f93acc5de94727da3572574959b6927327ac80af Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sun, 21 Nov 2021 09:35:44 +0000 Subject: [PATCH 113/153] Use extended email to send emails on failed build --- build/postactionstest.groovy | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/build/postactionstest.groovy b/build/postactionstest.groovy index 7db1fdc..150f5d1 100644 --- a/build/postactionstest.groovy +++ b/build/postactionstest.groovy @@ -12,9 +12,8 @@ pipeline { stage('Dummy build job') { steps { script { - echo "Params:\n${params.toString()}" echo "Execute dummy build job: ${CAUSE_ERROR}" - if (CAUSE_ERROR == true) { + if (CAUSE_ERROR == 'true') { error("Causing error") } } From 90e8e6763acbe731a2ae9f01d2a19233adbf75af Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sun, 21 Nov 2021 09:40:05 +0000 Subject: [PATCH 114/153] Use extended email to send emails on failed build --- build/postactions.groovy | 47 +++++++++++++++++++++++++++------------- 1 file changed, 32 insertions(+), 15 deletions(-) diff --git a/build/postactions.groovy b/build/postactions.groovy index 657f1e8..bca4454 100644 --- a/build/postactions.groovy +++ b/build/postactions.groovy @@ -192,21 +192,38 @@ def sendextemail(extmailinfo) { def recipientProviders = getRecipientProviders(extmailinfo['Recipient providers']) def toList = getToList(extmailinfo['To']) - emailext( - subject: "[Jenkins] Failed build: ${JOB_NAME} ${BUILD_DISPLAY_NAME}", - body: '''${JELLY_SCRIPT,template="html"}''', - attachLog: true, - // attachmentsPattern: '', - compressLog: false, - // from : '', - mimeType: 'text/html', - // postsendScript: '', - // presendScript: '', - recipientProviders: recipientProviders, // Could be: buildUser, culprits, developers, brokenTestsSuspects, brokenBuildSuspects, recipients, requestor, upstreamDevelopers - // replyTo: '', - saveOutput: false, - to: toList, - ) + if (toList.size() == 0) { + emailext( + subject: "[Jenkins] Failed build: ${JOB_NAME} ${BUILD_DISPLAY_NAME}", + body: '''${JELLY_SCRIPT,template="html"}''', + attachLog: true, + // attachmentsPattern: '', + compressLog: false, + // from : '', + mimeType: 'text/html', + // postsendScript: '', + // presendScript: '', + recipientProviders: recipientProviders, // Could be: buildUser, culprits, developers, brokenTestsSuspects, brokenBuildSuspects, recipients, requestor, upstreamDevelopers + // replyTo: '', + saveOutput: false, + // to: toList, + ) + } else { + emailext( + subject: "[Jenkins] Failed build: ${JOB_NAME} ${BUILD_DISPLAY_NAME}", + body: '''${JELLY_SCRIPT,template="html"}''', + attachLog: true, + // attachmentsPattern: '', + compressLog: false, + // from : '', + mimeType: 'text/html', + // postsendScript: '', + // presendScript: '', + // recipientProviders: recipientProviders, // Could be: buildUser, culprits, developers, brokenTestsSuspects, brokenBuildSuspects, recipients, requestor, upstreamDevelopers + // replyTo: '', + saveOutput: false, + to: toList, + } } def performFailedBuildActions() { From 6779041a90cc43af25b5d8752d6ec6453699e412 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sun, 21 Nov 2021 09:40:56 +0000 Subject: [PATCH 115/153] Use extended email to send emails on failed build --- build/postactions.groovy | 1 + 1 file changed, 1 insertion(+) diff --git a/build/postactions.groovy b/build/postactions.groovy index bca4454..a7b0d7d 100644 --- a/build/postactions.groovy +++ b/build/postactions.groovy @@ -223,6 +223,7 @@ def sendextemail(extmailinfo) { // replyTo: '', saveOutput: false, to: toList, + ) } } From 5053f377f795cbf6173b1bc7be20d34fa6cc37de Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sun, 21 Nov 2021 09:44:35 +0000 Subject: [PATCH 116/153] Use extended email to send emails on failed build --- build/postactions.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/postactions.groovy b/build/postactions.groovy index a7b0d7d..27a843e 100644 --- a/build/postactions.groovy +++ b/build/postactions.groovy @@ -192,7 +192,7 @@ def sendextemail(extmailinfo) { def recipientProviders = getRecipientProviders(extmailinfo['Recipient providers']) def toList = getToList(extmailinfo['To']) - if (toList.size() == 0) { + if (!toList) { emailext( subject: "[Jenkins] Failed build: ${JOB_NAME} ${BUILD_DISPLAY_NAME}", body: '''${JELLY_SCRIPT,template="html"}''', From 941d5b31b31f4ce0b6ef63b516250dff1162c824 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sun, 21 Nov 2021 09:45:51 +0000 Subject: [PATCH 117/153] Use extended email to send emails on failed build --- build/postactions.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/postactions.groovy b/build/postactions.groovy index 27a843e..5846d01 100644 --- a/build/postactions.groovy +++ b/build/postactions.groovy @@ -192,7 +192,7 @@ def sendextemail(extmailinfo) { def recipientProviders = getRecipientProviders(extmailinfo['Recipient providers']) def toList = getToList(extmailinfo['To']) - if (!toList) { + if (toList.length() <= 0) { emailext( subject: "[Jenkins] Failed build: ${JOB_NAME} ${BUILD_DISPLAY_NAME}", body: '''${JELLY_SCRIPT,template="html"}''', From 944b95be8a8259dafa88e0212effc60b92af5310 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sun, 21 Nov 2021 09:47:51 +0000 Subject: [PATCH 118/153] Use extended email to send emails on failed build --- build/postactions.groovy | 2 ++ 1 file changed, 2 insertions(+) diff --git a/build/postactions.groovy b/build/postactions.groovy index 5846d01..51219fc 100644 --- a/build/postactions.groovy +++ b/build/postactions.groovy @@ -176,6 +176,7 @@ def getRecipientProviders(recipientProviderInfo) { } } } + echo "recipientProviders: ${recipientProviders.toString()}" return recipientProviders; } @@ -185,6 +186,7 @@ def String getToList(toListInfo) { if (toListInfo) { toList = toListInfo.join(',') } + echo "toList: ${toList}" return toList } From 7b58c8c8dcc726c97d836f49a7a1806c52a37b91 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sun, 21 Nov 2021 09:48:52 +0000 Subject: [PATCH 119/153] Use extended email to send emails on failed build --- build/postactions.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/postactions.groovy b/build/postactions.groovy index 51219fc..1d90d6f 100644 --- a/build/postactions.groovy +++ b/build/postactions.groovy @@ -181,7 +181,7 @@ def getRecipientProviders(recipientProviderInfo) { } def String getToList(toListInfo) { - def String toList + def String toList = '' if (toListInfo) { toList = toListInfo.join(',') From b2a9f194a08ffe877ed7971bae75986161820bf6 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sun, 21 Nov 2021 09:53:53 +0000 Subject: [PATCH 120/153] Use extended email to send emails on failed build --- build/postactions.groovy | 51 ++++++++++++++-------------------------- 1 file changed, 18 insertions(+), 33 deletions(-) diff --git a/build/postactions.groovy b/build/postactions.groovy index 1d90d6f..13c3634 100644 --- a/build/postactions.groovy +++ b/build/postactions.groovy @@ -176,6 +176,9 @@ def getRecipientProviders(recipientProviderInfo) { } } } + if (recipientProviders.size() == 0) { + recipientProviders = [culprits(), requestor(), developers(), upstreamDevelopers()] + } echo "recipientProviders: ${recipientProviders.toString()}" return recipientProviders; } @@ -194,39 +197,21 @@ def sendextemail(extmailinfo) { def recipientProviders = getRecipientProviders(extmailinfo['Recipient providers']) def toList = getToList(extmailinfo['To']) - if (toList.length() <= 0) { - emailext( - subject: "[Jenkins] Failed build: ${JOB_NAME} ${BUILD_DISPLAY_NAME}", - body: '''${JELLY_SCRIPT,template="html"}''', - attachLog: true, - // attachmentsPattern: '', - compressLog: false, - // from : '', - mimeType: 'text/html', - // postsendScript: '', - // presendScript: '', - recipientProviders: recipientProviders, // Could be: buildUser, culprits, developers, brokenTestsSuspects, brokenBuildSuspects, recipients, requestor, upstreamDevelopers - // replyTo: '', - saveOutput: false, - // to: toList, - ) - } else { - emailext( - subject: "[Jenkins] Failed build: ${JOB_NAME} ${BUILD_DISPLAY_NAME}", - body: '''${JELLY_SCRIPT,template="html"}''', - attachLog: true, - // attachmentsPattern: '', - compressLog: false, - // from : '', - mimeType: 'text/html', - // postsendScript: '', - // presendScript: '', - // recipientProviders: recipientProviders, // Could be: buildUser, culprits, developers, brokenTestsSuspects, brokenBuildSuspects, recipients, requestor, upstreamDevelopers - // replyTo: '', - saveOutput: false, - to: toList, - ) - } + emailext( + subject: "[Jenkins] Failed build: ${JOB_NAME} ${BUILD_DISPLAY_NAME}", + body: '''${JELLY_SCRIPT,template="html"}''', + attachLog: true, + // attachmentsPattern: '', + compressLog: false, + // from : '', + mimeType: 'text/html', + // postsendScript: '', + // presendScript: '', + recipientProviders: recipientProviders, // Could be: buildUser, culprits, developers, brokenTestsSuspects, brokenBuildSuspects, recipients, requestor, upstreamDevelopers + // replyTo: '', + saveOutput: false, + to: toList, + ) } def performFailedBuildActions() { From 752ed5410ea2747409f520b87b0544ed3ffabe08 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sun, 21 Nov 2021 14:40:19 +0000 Subject: [PATCH 121/153] Use extended email to send emails on failed build --- build/postactions.groovy | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/build/postactions.groovy b/build/postactions.groovy index 13c3634..97f065d 100644 --- a/build/postactions.groovy +++ b/build/postactions.groovy @@ -154,6 +154,13 @@ def sendemails(emailtolist) { } } +def recipientProviderMap = { + 'culprits': culprits(), + 'requestor': requestor(), + 'developers': developers(), + 'upstreamDevelopers': upstreamDevelopers(), +} + def getRecipientProviders(recipientProviderInfo) { def recipientProviders = [] @@ -161,17 +168,8 @@ def getRecipientProviders(recipientProviderInfo) { def recipientProviderInfoList = recipientProviderInfo['Recipient providers'] if (recipientProviderInfoList) { for(rp in recipientProviderInfoList) { - if (rp == 'culprits') { - recipientProviders.append(culprits()) - } - if (rp == 'requestor') { - recipientProviders.append(requestor()) - } - if (rp == 'developers') { - recipientProviders.append(developers()) - } - if (rp == 'upstreamDevelopers') { - recipientProviders.append(upstreamDevelopers()) + if (recipientProviderMap.containsKey(rp)) { + recipientProviders.append(recipientProviderMap[rp]) } } } From 804929b5621530aac7ec9301c4f8dea4a96b5bc9 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sun, 21 Nov 2021 14:44:18 +0000 Subject: [PATCH 122/153] Use extended email to send emails on failed build --- build/postactions.groovy | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/build/postactions.groovy b/build/postactions.groovy index 97f065d..39f92d2 100644 --- a/build/postactions.groovy +++ b/build/postactions.groovy @@ -161,16 +161,13 @@ def recipientProviderMap = { 'upstreamDevelopers': upstreamDevelopers(), } -def getRecipientProviders(recipientProviderInfo) { +def getRecipientProviders(recipientProviderInfoList) { def recipientProviders = [] - if (recipientProviderInfo) { - def recipientProviderInfoList = recipientProviderInfo['Recipient providers'] - if (recipientProviderInfoList) { - for(rp in recipientProviderInfoList) { - if (recipientProviderMap.containsKey(rp)) { - recipientProviders.append(recipientProviderMap[rp]) - } + if (recipientProviderInfoList) { + for(rp in recipientProviderInfoList) { + if (recipientProviderMap.containsKey(rp)) { + recipientProviders.append(recipientProviderMap[rp]) } } } From 39fcf5e79421baae68708b7dfae0aaebc96c8bc8 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sun, 21 Nov 2021 14:46:24 +0000 Subject: [PATCH 123/153] Use extended email to send emails on failed build --- build/postactions.groovy | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build/postactions.groovy b/build/postactions.groovy index 39f92d2..aeb50d1 100644 --- a/build/postactions.groovy +++ b/build/postactions.groovy @@ -154,12 +154,12 @@ def sendemails(emailtolist) { } } -def recipientProviderMap = { +def recipientProviderMap = [ 'culprits': culprits(), 'requestor': requestor(), 'developers': developers(), 'upstreamDevelopers': upstreamDevelopers(), -} +] def getRecipientProviders(recipientProviderInfoList) { def recipientProviders = [] From ae2c51512de132d6de69b69f73c55a1716ffcbad Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sun, 21 Nov 2021 15:02:21 +0000 Subject: [PATCH 124/153] Use extended email to send emails on failed build --- build/postactions.groovy | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/build/postactions.groovy b/build/postactions.groovy index aeb50d1..1fb322b 100644 --- a/build/postactions.groovy +++ b/build/postactions.groovy @@ -155,10 +155,10 @@ def sendemails(emailtolist) { } def recipientProviderMap = [ - 'culprits': culprits(), - 'requestor': requestor(), - 'developers': developers(), - 'upstreamDevelopers': upstreamDevelopers(), + culprits: culprits(), + requestor: requestor(), + developers: developers(), + upstreamDevelopers: upstreamDevelopers(), ] def getRecipientProviders(recipientProviderInfoList) { From eb7eed4e8800a6ab84803da14026085a16ec8fbb Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sun, 21 Nov 2021 15:16:05 +0000 Subject: [PATCH 125/153] Use extended email to send emails on failed build --- build/postactions.groovy | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/build/postactions.groovy b/build/postactions.groovy index 1fb322b..76bbbd4 100644 --- a/build/postactions.groovy +++ b/build/postactions.groovy @@ -154,14 +154,13 @@ def sendemails(emailtolist) { } } -def recipientProviderMap = [ - culprits: culprits(), - requestor: requestor(), - developers: developers(), - upstreamDevelopers: upstreamDevelopers(), -] - def getRecipientProviders(recipientProviderInfoList) { + def recipientProviderMap = [ + culprits: culprits(), + requestor: requestor(), + developers: developers(), + upstreamDevelopers: upstreamDevelopers(), + ] def recipientProviders = [] if (recipientProviderInfoList) { From 414a85fcea0b82864cb9ccc80ce42b485ec8a139 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sun, 21 Nov 2021 16:29:50 +0000 Subject: [PATCH 126/153] Use extended email to send emails on failed build --- build/postactions.groovy | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/build/postactions.groovy b/build/postactions.groovy index 76bbbd4..7699c5b 100644 --- a/build/postactions.groovy +++ b/build/postactions.groovy @@ -156,10 +156,10 @@ def sendemails(emailtolist) { def getRecipientProviders(recipientProviderInfoList) { def recipientProviderMap = [ - culprits: culprits(), - requestor: requestor(), - developers: developers(), - upstreamDevelopers: upstreamDevelopers(), + culprits: [$class: 'CulpritsRecipientProvider'], + requestor: [$class: 'RequesterRecipientProvider'], + developers: [$class: 'DevelopersRecipientProvider'], + upstreamDevelopers: [$class: 'UpstreamComitterRecipientProvider'], ] def recipientProviders = [] From c4ea96adcc1c5f620cb3d36c69a656598c88c1b5 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sun, 21 Nov 2021 16:40:32 +0000 Subject: [PATCH 127/153] Use extended email to send emails on failed build --- build/postactions.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/postactions.groovy b/build/postactions.groovy index 7699c5b..f9e0b72 100644 --- a/build/postactions.groovy +++ b/build/postactions.groovy @@ -166,7 +166,7 @@ def getRecipientProviders(recipientProviderInfoList) { if (recipientProviderInfoList) { for(rp in recipientProviderInfoList) { if (recipientProviderMap.containsKey(rp)) { - recipientProviders.append(recipientProviderMap[rp]) + recipientProviders.add(recipientProviderMap[rp]) } } } From 724179c07a8dac811d8a0e0dbbdc2da20c530c0a Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sun, 21 Nov 2021 17:16:36 +0000 Subject: [PATCH 128/153] Use extended email to send emails on failed build --- build/postactions.groovy | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/build/postactions.groovy b/build/postactions.groovy index f9e0b72..740bc0a 100644 --- a/build/postactions.groovy +++ b/build/postactions.groovy @@ -138,19 +138,23 @@ def performSuccessfulBuildActions() { deployjob(buildselector, postbuildactions, 'Release to git', 'RELEASE_TO_GIT_JOB') } -def sendemails(emailtolist) { - def emailbody = """ - Failed build: ${JOB_NAME} ${BUILD_DISPLAY_NAME} : ${BUILD_URL} +def sendemails(emailinfo) { + def emailtolist = emailinfo['To'] - Console output: ${BUILD_URL}console - """ - for(emailto in emailtolist) { - mail( - subject: "[Jenkins] Failed build: ${JOB_NAME} ${BUILD_DISPLAY_NAME}", - body: emailbody, - to: emailto - ) - echo "Send email to: ${emailto}" + if (emailtolist) { + def emailbody = """ + Failed build: ${JOB_NAME} ${BUILD_DISPLAY_NAME} : ${BUILD_URL} + + Console output: ${BUILD_URL}console + """ + for(emailto in emailtolist) { + mail( + subject: "[Jenkins] Failed build: ${JOB_NAME} ${BUILD_DISPLAY_NAME}", + body: emailbody, + to: emailto + ) + echo "Send email to: ${emailto}" + } } } @@ -220,9 +224,8 @@ def performFailedBuildActions() { } } if (postbuildactions) { - def emailtolist = postbuildactions['Email']['To'] - if (emailtolist) { - sendemails(emailtolist) + if (postbuildactions['Email']) { + sendemails(postbuildactions['Email']) } if (postbuildactions['ExtEmail']) { sendextemail(postbuildactions['ExtEmail']) From 4f57c1c19b0fb39b956667ccdd59c83ad18c9f71 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sun, 21 Nov 2021 20:34:52 +0000 Subject: [PATCH 129/153] Remove some post build log --- build/postactions.groovy | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/build/postactions.groovy b/build/postactions.groovy index 740bc0a..06ad8ad 100644 --- a/build/postactions.groovy +++ b/build/postactions.groovy @@ -81,7 +81,7 @@ def getActionJobName(postbuildactions, String action, String alternativeparamnam jobname = '' } } - echo "Job name for action: ${action}: ${jobname}" + // echo "Job name for action: ${action}: ${jobname}" return jobname } @@ -113,7 +113,7 @@ def deployjob(String buildselector, postbuildactions, String action, String alte def readPostBuildInfo() { def postbuildinfo = readJSON(text: POST_BUILD_INFO) def postbuildjsontext = writeJSON(returnText: true, json: postbuildinfo, pretty: 1) - echo "Post build info:\n${postbuildjsontext}" + // echo "Post build info:\n${postbuildjsontext}" return postbuildinfo } @@ -153,7 +153,7 @@ def sendemails(emailinfo) { body: emailbody, to: emailto ) - echo "Send email to: ${emailto}" + // echo "Send email to: ${emailto}" } } } @@ -177,7 +177,7 @@ def getRecipientProviders(recipientProviderInfoList) { if (recipientProviders.size() == 0) { recipientProviders = [culprits(), requestor(), developers(), upstreamDevelopers()] } - echo "recipientProviders: ${recipientProviders.toString()}" + // echo "recipientProviders: ${recipientProviders.toString()}" return recipientProviders; } @@ -187,7 +187,7 @@ def String getToList(toListInfo) { if (toListInfo) { toList = toListInfo.join(',') } - echo "toList: ${toList}" + // echo "toList: ${toList}" return toList } From df17c095ae03a24c245c9f45a0a173c8a175c5e1 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Thu, 25 Nov 2021 14:30:03 +0000 Subject: [PATCH 130/153] Correct import of print server binaries --- import/importer.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/import/importer.groovy b/import/importer.groovy index 818f0b7..2562693 100644 --- a/import/importer.groovy +++ b/import/importer.groovy @@ -160,7 +160,7 @@ def artifactimportfrombuildjob(meta, importoptions, String destpath) { conditionalClean(importoptions, destpath) echo "Build selector type: ${importoptions.m_buildnumberorselector.getClass()}" - + echo "Importing artifacts from job: ${importoptions.m_jobname} selector: ${importoptions.m_buildnumberorselector.toString()}" copyArtifacts( filter: formFilter(importoptions), excludes: importoptions.m_excludes, From 94ba8c77a4319a7e5c226ffc13968d70255d8d0d Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 30 Nov 2021 21:20:31 +0000 Subject: [PATCH 131/153] 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 132/153] 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 133/153] 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 134/153] 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 135/153] 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 136/153] 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 137/153] 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 138/153] 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 139/153] 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 140/153] 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 141/153] 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 142/153] 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 143/153] 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 144/153] 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 145/153] 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 146/153] 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 147/153] 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 148/153] 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 149/153] 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 150/153] 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 151/153] 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 152/153] 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 153/153] 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)