From 165888b6d98a6eaa5ddf9b32947eb7dc7407b388 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Mon, 10 Dec 2018 11:03:43 +0000 Subject: [PATCH 01/57] Turn off fingerprinting --- install/installhelper.gsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/installhelper.gsh b/install/installhelper.gsh index a55292d..c1ccc6a 100644 --- a/install/installhelper.gsh +++ b/install/installhelper.gsh @@ -9,7 +9,7 @@ def artifactsImporter(artifactDetails, installerDetails) { env.importDest = destFolder if (artifactFetched.get(artifactKey) == null) { //echo "Artifact info: ${artifactInfo}" - copyArtifacts excludes: notToCopy, filter: toCopy, fingerprintArtifacts: true, projectName: "${sourceProject}", selector: lastSuccessful(), target: "${destFolder}" + copyArtifacts excludes: notToCopy, filter: toCopy, fingerprintArtifacts: false, projectName: "${sourceProject}", selector: lastSuccessful(), target: "${destFolder}" def componentVersionFolder = "${WORKSPACE}\\version\\version_${artifactKey}" def folderToCopy = "${destFolder}\\version" echo "Copying from: ${folderToCopy} to: ${componentVersionFolder}" From 4df4b0d568ea3401acbef1bbacdd4f3bd31bf081 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Mon, 28 Jan 2019 11:18:49 +0000 Subject: [PATCH 02/57] Certain components are built from the same source repository so therefore their version numbers should not be incremented when they are imported into a build component using the same source repository --- artifacts/metaexport.groovy | 5 +++-- import/importer.groovy | 12 ++++++++---- install/installhelper.groovy | 4 ++-- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/artifacts/metaexport.groovy b/artifacts/metaexport.groovy index 0ca5da7..043c4de 100644 --- a/artifacts/metaexport.groovy +++ b/artifacts/metaexport.groovy @@ -9,11 +9,12 @@ def combineSubjobArtifacts(meta, subJobs) { if (subJobObject != null) { def subJobName = subJobObject.getProjectName() def subJobNumber = subJobObject.getNumber() - destFolder = subJob[1] + def destFolder = subJob[1] + def boolean incrementversionnumber = subJob[2] dir(destFolder) { deleteDir() } - importer.artifactimport(meta, subJobName, subJobNumber, destFolder) + importer.artifactimport(meta, subJobName, subJobNumber, destFolder, incrementversionnumber) artifactFolders.add("${destFolder}/**") } } diff --git a/import/importer.groovy b/import/importer.groovy index 1f89426..5c996b4 100644 --- a/import/importer.groovy +++ b/import/importer.groovy @@ -1,6 +1,6 @@ versiongenerator = load("${autobuilder.commonscripts()}/versionnumbering/generate.groovy") -def artifactimport(meta, String jenkinsjob, int buildnumber, String destpath, String filter = '**', String excludes = '', boolean fingerprint = false) { +def artifactimport(meta, String jenkinsjob, int buildnumber, String destpath, boolean incrementversionnumber = true, String filter = '**', String excludes = '', boolean fingerprint = false) { copyArtifacts( filter: filter, excludes: excludes, @@ -10,11 +10,13 @@ def artifactimport(meta, String jenkinsjob, int buildnumber, String destpath, St target: destpath ) def importedmeta = meta.importrelated(destpath) - meta.buildstampinfo.changerevision(versiongenerator.incrementrevision(meta.buildstampinfo.revision, importedmeta.buildstampinfo.revision)) + if (incrementversionnumber) { + meta.buildstampinfo.changerevision(versiongenerator.incrementrevision(meta.buildstampinfo.revision, importedmeta.buildstampinfo.revision)) + } return importedmeta } -def artifactimport(meta, String jenkinsjob, String buildselector, String destpath, String filter = '**', String excludes = '', boolean fingerprint = false) { +def artifactimport(meta, String jenkinsjob, String buildselector, String destpath, boolean incrementversionnumber = true, String filter = '**', String excludes = '', boolean fingerprint = false) { copyArtifacts( filter: filter, excludes: excludes, @@ -27,7 +29,9 @@ def artifactimport(meta, String jenkinsjob, String buildselector, String destpat target: destpath ) def importedmeta = meta.importrelated(destpath) - meta.buildstampinfo.changerevision(versiongenerator.incrementrevision(meta.buildstampinfo.revision, importedmeta.buildstampinfo.revision)) + if (incrementversionnumber) { + meta.buildstampinfo.changerevision(versiongenerator.incrementrevision(meta.buildstampinfo.revision, importedmeta.buildstampinfo.revision)) + } return importedmeta } diff --git a/install/installhelper.groovy b/install/installhelper.groovy index 093ddef..03ee9e4 100644 --- a/install/installhelper.groovy +++ b/install/installhelper.groovy @@ -5,9 +5,9 @@ def Map artifactsImporter(meta, artifactDetails, installerDetails) { def importer = load("${autobuilder.commonscripts()}/import/importer.groovy") for (installer in toBuild) { def artifactKey = installerDetails.get(installer)[0] - (sourceProject, sourceselector, destFolder, toCopy, notToCopy, binariesFolders) = artifactDetails.get(artifactKey) + (sourceProject, sourceselector, destFolder, incrementversionnumber, toCopy, notToCopy, binariesFolders) = artifactDetails.get(artifactKey) if (artifactFetched.get(artifactKey) == null) { - def importmeta = importer.artifactimport(meta, sourceProject, sourceselector, destFolder, toCopy, notToCopy) + def importmeta = importer.artifactimport(meta, sourceProject, sourceselector, destFolder, incrementversionnumber, toCopy, notToCopy) artifactFetched.put(artifactKey, importmeta) } } From bae55fa66609d54a7537bc71e9b4cbf2977dc9fd Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Mon, 28 Jan 2019 22:14:31 +0000 Subject: [PATCH 03/57] Alter location of differences file so that it no longer gets published --- meta/folder.groovy | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/meta/folder.groovy b/meta/folder.groovy index 2ef8e22..461a8fb 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -419,6 +419,7 @@ class PublishableInfo extends GISJsonSerialised { class MetaInfo extends GISJsonSerialised { private static String FORMAT = "0.1" private static String METAFOLDERNAME = "meta" + private static String DIFFFOLDERNAME = "diff" private static String METAFILENAME = "info.json" private static String METADIFFFILENAME = "differences.txt" private static String METAARTIFACTS = "${METAFOLDERNAME}/**" @@ -565,7 +566,7 @@ class MetaInfo extends GISJsonSerialised { } static String difffilepath() { - return METAFOLDERNAME + "/" + METADIFFFILENAME + return DIFFFOLDERNAME + "/" + METADIFFFILENAME } MetaInfo importrelated(String destpath) { From 553feb031b3a06fd2e2425e7cc023dee6885f249 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Mon, 28 Jan 2019 23:07:18 +0000 Subject: [PATCH 04/57] Alter location of differences file so that it no longer gets published --- meta/folder.groovy | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/meta/folder.groovy b/meta/folder.groovy index 461a8fb..efc8df2 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -423,6 +423,7 @@ class MetaInfo extends GISJsonSerialised { private static String METAFILENAME = "info.json" private static String METADIFFFILENAME = "differences.txt" private static String METAARTIFACTS = "${METAFOLDERNAME}/**" + private static String DIFFARTIFACTS = "${DIFFFOLDERNAME}/**" class RelatedMetaInfo extends GISJsonSerialised { String offsetpath @@ -621,7 +622,7 @@ class MetaInfo extends GISJsonSerialised { ArrayList releasedfromsubmeta = new ArrayList(), // These items are not recorded in meta as released from here String metafilepath ="${METAFOLDERNAME}/${METAFILENAME}" ) { - def String artifactlist = METAARTIFACTS + def String artifactlist = "${METAARTIFACTS},${DIFFARTIFACTS}" releaseinfo.addReleaseItem(METAARTIFACTS) for (releaseitem in releasedfromhere) { artifactlist += "," + releaseitem From f37be2706ac69392bad0da925d25e1702cf80652 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 26 Feb 2019 16:07:52 +0000 Subject: [PATCH 05/57] Try to create WORKSPACE relative paths --- meta/folder.groovy | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/meta/folder.groovy b/meta/folder.groovy index 52ceb06..245d961 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -554,13 +554,16 @@ class MetaInfo extends GISJsonSerialised { } String relativize(String path) { - def Path thispath = Paths.get(path) - if (thispath.startsWith(script.WORKSPACE)) { + def Path mypath = Paths.get(path) + String pathRelative + if (mypath.startsWith(script.WORKSPACE)) { def Path wspath = Paths.get(script.WORKSPACE) - def Path wsrelativePath = wspath.relativize(thispath) - return wsrelativePath.toString() + def Path wsrelativePath = wspath.relativize(mypath) + pathRelative = wsrelativePath.toString() + } else { + pathRelative = mypath.toString() } - return path + return pathRelative } static String metafilepath() { From bdcc0833e8dc003f022c9eaa7def5370403ea0de Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 26 Feb 2019 17:05:25 +0000 Subject: [PATCH 06/57] offsetpath field in meta files was absolute; should be relative to workspace --- meta/folder.groovy | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/meta/folder.groovy b/meta/folder.groovy index 245d961..d7cbc4f 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -556,12 +556,15 @@ class MetaInfo extends GISJsonSerialised { String relativize(String path) { def Path mypath = Paths.get(path) String pathRelative - if (mypath.startsWith(script.WORKSPACE)) { + script.echo("Seeing if ${path} begins with from ${script.WORKSPACE}") + if (path.startsWith(script.WORKSPACE)) { def Path wspath = Paths.get(script.WORKSPACE) def Path wsrelativePath = wspath.relativize(mypath) pathRelative = wsrelativePath.toString() + script.echo("Extracted ${pathRelative} from ${wspath.toString()} and ${mypath.toString()}" } else { pathRelative = mypath.toString() + script.echo("Path relative is unchanged: ${pathRelative}" } return pathRelative } From 8bfaeda1e14ed816aeefebc6d07a595187dd1dfa Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 26 Feb 2019 17:07:33 +0000 Subject: [PATCH 07/57] offsetpath field in meta files was absolute; should be relative to workspace --- meta/folder.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta/folder.groovy b/meta/folder.groovy index d7cbc4f..0c94a12 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -561,7 +561,7 @@ class MetaInfo extends GISJsonSerialised { def Path wspath = Paths.get(script.WORKSPACE) def Path wsrelativePath = wspath.relativize(mypath) pathRelative = wsrelativePath.toString() - script.echo("Extracted ${pathRelative} from ${wspath.toString()} and ${mypath.toString()}" + script.echo("Extracted ${pathRelative} from ${wspath.toString()} and ${mypath.toString()}") } else { pathRelative = mypath.toString() script.echo("Path relative is unchanged: ${pathRelative}" From cd1226b83acc540ad3fb9754b3903b4970d42058 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 26 Feb 2019 17:18:29 +0000 Subject: [PATCH 08/57] offsetpath field in meta files was absolute; should be relative to workspace --- meta/folder.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta/folder.groovy b/meta/folder.groovy index 0c94a12..f6797a2 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -564,7 +564,7 @@ class MetaInfo extends GISJsonSerialised { script.echo("Extracted ${pathRelative} from ${wspath.toString()} and ${mypath.toString()}") } else { pathRelative = mypath.toString() - script.echo("Path relative is unchanged: ${pathRelative}" + script.echo("Path relative is unchanged: ${pathRelative}") } return pathRelative } From 3926df768bf61fdd3ef92980598c5f8fc65eb2d8 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 26 Feb 2019 17:21:14 +0000 Subject: [PATCH 09/57] offsetpath field in meta files was absolute; should be relative to workspace --- meta/folder.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta/folder.groovy b/meta/folder.groovy index f6797a2..ce041d0 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -556,7 +556,7 @@ class MetaInfo extends GISJsonSerialised { String relativize(String path) { def Path mypath = Paths.get(path) String pathRelative - script.echo("Seeing if ${path} begins with from ${script.WORKSPACE}") + script.echo("Seeing if ${path} begins with ${script.WORKSPACE}") if (path.startsWith(script.WORKSPACE)) { def Path wspath = Paths.get(script.WORKSPACE) def Path wsrelativePath = wspath.relativize(mypath) From eb37e310949a8bbceb71dac47c5285a89b9b1b6d Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 26 Feb 2019 17:45:39 +0000 Subject: [PATCH 10/57] offsetpath field in meta files was absolute; should be relative to workspace --- meta/folder.groovy | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/meta/folder.groovy b/meta/folder.groovy index ce041d0..74c00cc 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -553,17 +553,14 @@ class MetaInfo extends GISJsonSerialised { deserialiseJson(rawmeta) } - String relativize(String path) { - def Path mypath = Paths.get(path) + String relativize(String mypath) { String pathRelative - script.echo("Seeing if ${path} begins with ${script.WORKSPACE}") - if (path.startsWith(script.WORKSPACE)) { - def Path wspath = Paths.get(script.WORKSPACE) - def Path wsrelativePath = wspath.relativize(mypath) - pathRelative = wsrelativePath.toString() - script.echo("Extracted ${pathRelative} from ${wspath.toString()} and ${mypath.toString()}") + script.echo("Seeing if ${mypath} begins with ${script.WORKSPACE}") + if (mypath.startsWith(script.WORKSPACE)) { + pathRelative = mypath.minus(script.WORKSPACE) + script.echo("Extracted ${pathRelative} from ${script.WORKSPACE} and ${mypath}") } else { - pathRelative = mypath.toString() + pathRelative = mypath script.echo("Path relative is unchanged: ${pathRelative}") } return pathRelative From c8fa1243fd3c38062517254701a26c7bf11414d7 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 26 Feb 2019 18:07:16 +0000 Subject: [PATCH 11/57] offsetpath field in meta files was absolute; should be relative to workspace --- meta/folder.groovy | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/meta/folder.groovy b/meta/folder.groovy index 74c00cc..1f90c61 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -563,6 +563,13 @@ class MetaInfo extends GISJsonSerialised { pathRelative = mypath script.echo("Path relative is unchanged: ${pathRelative}") } + // Strip leading / if any + pathRelative = pathRelative.replaceAll("^/+", "") + // Strip leading \ if any + pathRelative = pathRelative.replaceAll("^\\+", "") + + script.echo("Path relative is ${pathRelative}") + return pathRelative } From 4425de19dcbca4b1e9f8843040f7c0a4052bae84 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Wed, 27 Feb 2019 08:06:38 +0000 Subject: [PATCH 12/57] offsetpath field in meta files was absolute; should be relative to workspace --- meta/folder.groovy | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/meta/folder.groovy b/meta/folder.groovy index 1f90c61..3a4d464 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -564,9 +564,11 @@ class MetaInfo extends GISJsonSerialised { script.echo("Path relative is unchanged: ${pathRelative}") } // Strip leading / if any - pathRelative = pathRelative.replaceAll("^/+", "") + pathRelative = pathRelative.replaceAll('^/+', '') // Strip leading \ if any - pathRelative = pathRelative.replaceAll("^\\+", "") + pathRelative = pathRelative.replaceAll('^\\+', '') + // Convert \ with / + pathRelative = pathRelative.replaceAll('\\', '/') script.echo("Path relative is ${pathRelative}") From d7ecd0f1809de688e109ffefdddc8cc1dd7069cb Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Wed, 27 Feb 2019 08:23:02 +0000 Subject: [PATCH 13/57] offsetpath field in meta files was absolute; should be relative to workspace --- meta/folder.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta/folder.groovy b/meta/folder.groovy index 3a4d464..adfee97 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -568,7 +568,7 @@ class MetaInfo extends GISJsonSerialised { // Strip leading \ if any pathRelative = pathRelative.replaceAll('^\\+', '') // Convert \ with / - pathRelative = pathRelative.replaceAll('\\', '/') + pathRelative = pathRelative.replace('\\', '/') script.echo("Path relative is ${pathRelative}") From dedcdfd5e964d005d59ec7cffa50b0ae7bf3715d Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Wed, 27 Feb 2019 08:46:23 +0000 Subject: [PATCH 14/57] offsetpath field in meta files was absolute; should be relative to workspace --- meta/folder.groovy | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/meta/folder.groovy b/meta/folder.groovy index adfee97..f9d4bf3 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -563,12 +563,10 @@ class MetaInfo extends GISJsonSerialised { pathRelative = mypath script.echo("Path relative is unchanged: ${pathRelative}") } + // Convert \ with / + pathRelative = pathRelative.tokenize('\\').join('/') // Strip leading / if any pathRelative = pathRelative.replaceAll('^/+', '') - // Strip leading \ if any - pathRelative = pathRelative.replaceAll('^\\+', '') - // Convert \ with / - pathRelative = pathRelative.replace('\\', '/') script.echo("Path relative is ${pathRelative}") From aeb2669473c83d694e89cdb3a0d6b197eed2a1e9 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Wed, 27 Mar 2019 08:56:29 +0000 Subject: [PATCH 15/57] Handle the artifact source parameter --- import/importer.groovy | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/import/importer.groovy b/import/importer.groovy index 5c996b4..40151e1 100644 --- a/import/importer.groovy +++ b/import/importer.groovy @@ -35,4 +35,18 @@ def artifactimport(meta, String jenkinsjob, String buildselector, String destpat return importedmeta } +def artifactimport(meta, String source, String jenkinsjob, buildnumberorselector, String repo, String revision, String destpath, boolean incrementversionnumber = true, String filter = '**', String excludes = '', boolean fingerprint = false) { + switch (source) { + case "Jenkins job artifact": { + return artifactimport(meta, jenkinsjob, buildnumberorselector, destpath, incrementversionnumber, filter, excludes, fingerprint) + } + case "Release repository": { + return artifactimportfromrepo(meta, repo, revision, destpath, incrementversionnumber, filter, excludes, fingerprint) + } + default: + error("Unknown type of artifact source: ${source}") + } + return meta +} + return this; From a6ce45b21441f9f79aa4ed0fa14b87f3bac536b2 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Wed, 27 Mar 2019 08:59:37 +0000 Subject: [PATCH 16/57] Handle the artifact source parameter --- import/importer.groovy | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/import/importer.groovy b/import/importer.groovy index 40151e1..abf3b2f 100644 --- a/import/importer.groovy +++ b/import/importer.groovy @@ -37,12 +37,10 @@ def artifactimport(meta, String jenkinsjob, String buildselector, String destpat def artifactimport(meta, String source, String jenkinsjob, buildnumberorselector, String repo, String revision, String destpath, boolean incrementversionnumber = true, String filter = '**', String excludes = '', boolean fingerprint = false) { switch (source) { - case "Jenkins job artifact": { + case "Jenkins job artifact": return artifactimport(meta, jenkinsjob, buildnumberorselector, destpath, incrementversionnumber, filter, excludes, fingerprint) - } - case "Release repository": { + case "Release repository": return artifactimportfromrepo(meta, repo, revision, destpath, incrementversionnumber, filter, excludes, fingerprint) - } default: error("Unknown type of artifact source: ${source}") } From ad00620c74ff87efb91ed4c53d309123d2037e97 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Mon, 8 Apr 2019 15:53:44 +0100 Subject: [PATCH 17/57] Perform installer file (ISM) checking --- install/installhelper.groovy | 45 +++++++++++++++++++++++++++++++++++- 1 file changed, 44 insertions(+), 1 deletion(-) diff --git a/install/installhelper.groovy b/install/installhelper.groovy index 819a580..d064161 100644 --- a/install/installhelper.groovy +++ b/install/installhelper.groovy @@ -30,4 +30,47 @@ def placeBinaries(artifactDetails, installerDetails) { } } -return this; \ No newline at end of file +def checkISMfile(String ISMfile) { + def xmlFile = new File(ISMfile) + + def parsedxml = new XmlParser().parse(xmlFile) + def pathvariableinfo = [:] + def exitcode = 0 + // Load up a map of path variable and path pairs + // Ignore blank path definitions + // Ignore the workspace definition which should have the only absolute path + parsedxml.each{ table -> + if (table.@name == "ISPathVariable") { + table.row.each{ row -> + def pathname = row.td[0].value()[0] + def path = row.td[1].value()[0] + if (path && pathname != "WORKSPACE") { + pathvariableinfo[pathname] = path + } + } + } + } + // Check that each path variable is defined beginning with a path variable or the WORKSPACE one + pathvariableinfo.each{ pair -> + println "pair key: ${pair.key} value: ${pair.value}" + def path = pair.value + def pathvarmatcher = path =~ /<(.*)>.*/ + if (pathvarmatcher.matches()) { + def pathvarfound = pathvarmatcher.group(1) + if (pathvarfound != 'WORKSPACE') { + if (!pathvariableinfo.containsKey(pathvarfound)) { + println "Undefined path variable ${pathvarfound} found" + exitcode = 1 + } + } + } else { + println "Path: ${path} does not begin with a path variable" + exitcode = 1 + } + } + if (exitcode > 0) { + error "The ISM file: ${ISMfile} contains a path that is either absolute or does not begin with another path variable definition" + } +} + +return this; From 1435d338acc9019903594c3b2298bd4ab3150f2b Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Mon, 8 Apr 2019 17:58:05 +0100 Subject: [PATCH 18/57] Perform installer file (ISM) checking --- install/installhelper.groovy | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install/installhelper.groovy b/install/installhelper.groovy index d064161..886c604 100644 --- a/install/installhelper.groovy +++ b/install/installhelper.groovy @@ -31,9 +31,9 @@ def placeBinaries(artifactDetails, installerDetails) { } def checkISMfile(String ISMfile) { - def xmlFile = new File(ISMfile) + def xml = readFile(ISMfile) - def parsedxml = new XmlParser().parse(xmlFile) + def parsedxml = new XmlParser().parseText(xml) def pathvariableinfo = [:] def exitcode = 0 // Load up a map of path variable and path pairs From ee7da8715fc2b4f4b8f2fb269207746d83d409ca Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Mon, 8 Apr 2019 18:07:31 +0100 Subject: [PATCH 19/57] Perform installer file (ISM) checking --- install/installhelper.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/installhelper.groovy b/install/installhelper.groovy index 886c604..6cecb85 100644 --- a/install/installhelper.groovy +++ b/install/installhelper.groovy @@ -33,7 +33,7 @@ def placeBinaries(artifactDetails, installerDetails) { def checkISMfile(String ISMfile) { def xml = readFile(ISMfile) - def parsedxml = new XmlParser().parseText(xml) + def parsedxml = new XmlParser(true, true, true).parseText(xml) def pathvariableinfo = [:] def exitcode = 0 // Load up a map of path variable and path pairs From 63202270913c56490108966727ca6edca7e11950 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Mon, 8 Apr 2019 18:21:53 +0100 Subject: [PATCH 20/57] Perform installer file (ISM) checking --- install/installhelper.groovy | 1 + 1 file changed, 1 insertion(+) diff --git a/install/installhelper.groovy b/install/installhelper.groovy index 6cecb85..f3dcdd4 100644 --- a/install/installhelper.groovy +++ b/install/installhelper.groovy @@ -30,6 +30,7 @@ def placeBinaries(artifactDetails, installerDetails) { } } +@NonCPS def checkISMfile(String ISMfile) { def xml = readFile(ISMfile) From 1c10bfba373c73007a0ca0cae5cb2ec611bd0f24 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Mon, 8 Apr 2019 18:30:16 +0100 Subject: [PATCH 21/57] Perform installer file (ISM) checking --- install/installhelper.groovy | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/install/installhelper.groovy b/install/installhelper.groovy index f3dcdd4..823c117 100644 --- a/install/installhelper.groovy +++ b/install/installhelper.groovy @@ -33,7 +33,8 @@ def placeBinaries(artifactDetails, installerDetails) { @NonCPS def checkISMfile(String ISMfile) { def xml = readFile(ISMfile) - + echo "Checking ISM file: ${ISMfile}" + def parsedxml = new XmlParser(true, true, true).parseText(xml) def pathvariableinfo = [:] def exitcode = 0 @@ -53,24 +54,26 @@ def checkISMfile(String ISMfile) { } // Check that each path variable is defined beginning with a path variable or the WORKSPACE one pathvariableinfo.each{ pair -> - println "pair key: ${pair.key} value: ${pair.value}" + echo "pair key: ${pair.key} value: ${pair.value}" def path = pair.value def pathvarmatcher = path =~ /<(.*)>.*/ if (pathvarmatcher.matches()) { def pathvarfound = pathvarmatcher.group(1) if (pathvarfound != 'WORKSPACE') { if (!pathvariableinfo.containsKey(pathvarfound)) { - println "Undefined path variable ${pathvarfound} found" + echo "Undefined path variable ${pathvarfound} found" exitcode = 1 } } } else { - println "Path: ${path} does not begin with a path variable" + echo "Path: ${path} does not begin with a path variable" exitcode = 1 } } if (exitcode > 0) { error "The ISM file: ${ISMfile} contains a path that is either absolute or does not begin with another path variable definition" + } else { + echo "ISM file: ${ISMfile} - ok" } } From 08a7350ee8eed79257c89a310a10de6580d04d8c Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 9 Apr 2019 08:39:15 +0100 Subject: [PATCH 22/57] Perform installer file (ISM) checking --- install/installhelper.groovy | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/install/installhelper.groovy b/install/installhelper.groovy index 823c117..51edd3d 100644 --- a/install/installhelper.groovy +++ b/install/installhelper.groovy @@ -31,9 +31,8 @@ def placeBinaries(artifactDetails, installerDetails) { } @NonCPS -def checkISMfile(String ISMfile) { - def xml = readFile(ISMfile) - echo "Checking ISM file: ${ISMfile}" +def checkISMfilebackend(String xml) { + def String message = "" def parsedxml = new XmlParser(true, true, true).parseText(xml) def pathvariableinfo = [:] @@ -54,26 +53,31 @@ def checkISMfile(String ISMfile) { } // Check that each path variable is defined beginning with a path variable or the WORKSPACE one pathvariableinfo.each{ pair -> - echo "pair key: ${pair.key} value: ${pair.value}" + message += "pair key: ${pair.key} value: ${pair.value}\n" def path = pair.value def pathvarmatcher = path =~ /<(.*)>.*/ if (pathvarmatcher.matches()) { def pathvarfound = pathvarmatcher.group(1) if (pathvarfound != 'WORKSPACE') { if (!pathvariableinfo.containsKey(pathvarfound)) { - echo "Undefined path variable ${pathvarfound} found" + message += "Undefined path variable ${pathvarfound} found\n" exitcode = 1 } } } else { - echo "Path: ${path} does not begin with a path variable" + message += "Path: ${path} does not begin with a path variable\n" exitcode = 1 } } + return [exitcode, message] +} + +def checkISMfile(String ISMfile) { + echo "Checking ISM file: ${ISMfile}" + def xml = readFile(ISMfile) + (exitcode, message) = checkISMfilebackend(xml) if (exitcode > 0) { - error "The ISM file: ${ISMfile} contains a path that is either absolute or does not begin with another path variable definition" - } else { - echo "ISM file: ${ISMfile} - ok" + error "ISM file errors found:\n${message}" } } From b7c5f9805b841417dc59a28c2a1fa96fb8374fcf Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 9 Apr 2019 08:57:32 +0100 Subject: [PATCH 23/57] Perform installer file (ISM) checking --- install/installhelper.groovy | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/install/installhelper.groovy b/install/installhelper.groovy index 51edd3d..6ac2e80 100644 --- a/install/installhelper.groovy +++ b/install/installhelper.groovy @@ -42,10 +42,10 @@ def checkISMfilebackend(String xml) { // Ignore the workspace definition which should have the only absolute path parsedxml.each{ table -> if (table.@name == "ISPathVariable") { - table.row.each{ row -> - def pathname = row.td[0].value()[0] - def path = row.td[1].value()[0] - if (path && pathname != "WORKSPACE") { + table['row'].each{ row -> + def pathname = row['td'][0].value()[0] + def path = row['td'][1].value()[0] + if (path && pathname != 'WORKSPACE') { pathvariableinfo[pathname] = path } } From f141d804103ce3301c18dbe79cdeaf10fd61d188 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 9 Apr 2019 09:30:24 +0100 Subject: [PATCH 24/57] Perform installer file (ISM) checking --- install/installhelper.groovy | 3 +++ 1 file changed, 3 insertions(+) diff --git a/install/installhelper.groovy b/install/installhelper.groovy index 6ac2e80..ca9c502 100644 --- a/install/installhelper.groovy +++ b/install/installhelper.groovy @@ -78,6 +78,9 @@ def checkISMfile(String ISMfile) { (exitcode, message) = checkISMfilebackend(xml) if (exitcode > 0) { error "ISM file errors found:\n${message}" + } else { + echo "Checked ISM file: ${ISMfile} - ok" + echo message } } From 2317111f3bde99ef2feae3a6feaaade1dd78868d Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 9 Apr 2019 10:44:43 +0100 Subject: [PATCH 25/57] Perform installer file (ISM) checking --- install/installhelper.groovy | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/install/installhelper.groovy b/install/installhelper.groovy index ca9c502..1464e9d 100644 --- a/install/installhelper.groovy +++ b/install/installhelper.groovy @@ -76,11 +76,11 @@ def checkISMfile(String ISMfile) { echo "Checking ISM file: ${ISMfile}" def xml = readFile(ISMfile) (exitcode, message) = checkISMfilebackend(xml) + echo message if (exitcode > 0) { - error "ISM file errors found:\n${message}" + error "ISM file errors found" } else { - echo "Checked ISM file: ${ISMfile} - ok" - echo message + echo "Checked ISM file - ok" } } From 4bb8bcec23a4ced93535ab7d4f19538568b30ba1 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 7 May 2019 10:28:39 +0100 Subject: [PATCH 26/57] Warn of git stripping not being supported in Windows --- versioncontrol/git.groovy | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/versioncontrol/git.groovy b/versioncontrol/git.groovy index f72fc5a..b639c91 100644 --- a/versioncontrol/git.groovy +++ b/versioncontrol/git.groovy @@ -170,13 +170,17 @@ boolean checkAllVersionsAgree(java.util.LinkedHashMap versions) { def stripgithistory(String rootfolder) { echo "Stripping git history out of ${rootfolder}" dir(rootfolder) { - sh """#!/bin/bash - pwd - find . -type d -name ".git" | xargs -iXX rm -rf XX - find . -name ".gitignore" | xargs -iXX rm -rf XX - find . -name ".gitmodules" | xargs -iXX rm -rf XX - find . -iname ".gitattributes" | xargs -iXX rm -rf XX - """ + if (isUnix()) { + sh """#!/bin/bash + pwd + find . -type d -name ".git" | xargs -iXX rm -rf XX + find . -name ".gitignore" | xargs -iXX rm -rf XX + find . -name ".gitmodules" | xargs -iXX rm -rf XX + find . -iname ".gitattributes" | xargs -iXX rm -rf XX + """ + } else { + echo "Not supporting git stripping in Windows at the moment" + } } } From a6fe97d65e5b7c3c3a45ce53ff4f6f150b6b931c Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Thu, 23 May 2019 19:39:52 +0100 Subject: [PATCH 27/57] MCS-425 - Perform a sparse checkout of items to import from a release repo --- import/importer.groovy | 23 ++++++++++++++++++++++- publish/do.groovy | 13 +++++++++++++ 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/import/importer.groovy b/import/importer.groovy index 34707bc..9620e8a 100644 --- a/import/importer.groovy +++ b/import/importer.groovy @@ -42,7 +42,7 @@ def rewritemetafileasreleased(meta, String filepath) { meta.saveJsonSerialised(filepath) } -def artifactimportfromrepo(meta, String repo, String revision, String destpath, boolean incrementversionnumber = true, String filter = '**', String excludes = '', boolean fingerprint = false) { +def hierarchyartifactimportfromrepo(meta, String repo, String revision, String destpath, boolean incrementversionnumber = true, String filter = '**', String excludes = '', boolean fingerprint = false) { def rooturl = repo.trim() def rootrevision = revision.trim() echo "Cloning root release repo: ${rooturl}, revision: ${rootrevision} at folder: ${destpath}" @@ -76,6 +76,27 @@ def artifactimportfromrepo(meta, String repo, String revision, String destpath, return importedmeta } +def artifactimportfromrepo(meta, String repo, String revision, String destpath, boolean incrementversionnumber = true, String filter = '**', String excludes = '', boolean fingerprint = false) { + def rooturl = repo.trim() + def rootrevision = revision.trim() + echo "Cloning root release repo: ${rooturl}, revision: ${rootrevision} at folder: ${destpath}" + + def ArrayList sparseitemlist = gh.convertstringitemstopublish(filter) { + gh.gitCheckoutAlt(rooturl, rootrevision, destpath, "", 1, true, sparseitemlist) + + def importedmeta = meta.importrelated(destpath) + + gh.stripgithistory(destpath) + def metafilepath = "${destpath}/${meta.metafilepath()}" + echo "Marking root meta as released and rewriting meta file: ${metafilepath}" + rewritemetafileasreleased(meta, metafilepath) + + if (incrementversionnumber) { + meta.buildstampinfo.changerevision(versiongenerator.incrementrevision(meta.buildstampinfo.revision, importedmeta.buildstampinfo.revision)) + } + return importedmeta +} + def artifactimport(meta, String source, String jenkinsjob, buildnumberorselector, String repo, String revision, String destpath, boolean incrementversionnumber = true, String filter = '**', String excludes = '', boolean fingerprint = false) { switch (source) { case "Jenkins job artifact": diff --git a/publish/do.groovy b/publish/do.groovy index 1599ca8..6207380 100644 --- a/publish/do.groovy +++ b/publish/do.groovy @@ -148,6 +148,19 @@ def convertitemstopublish(String itemstopublishstring) { return paths } +def convertstringitemstopublish(String itemstopublishstring) { + def List paths = [] + + def String[] items = itemstopublishstring.split(',') + def String allpaths = "" + for(String item : items) { + paths.add(item) + allpaths += "${path}\n" + } + echo "Selected item to publish:\n${allpaths}" + return paths +} + // Publish selected items from a release to the customer folder on the ftp site // itemstopublishstring is a comma-seperated set of strings in this format ## def publishhierarchy(releasemeta, String itemstopublishstring, String customer, String softwarerelease, String maxdepth) { From 907a0f00e6b488f167c7ecd5a0a46f708ca29b6c Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Thu, 23 May 2019 23:04:39 +0100 Subject: [PATCH 28/57] MCS-425 - Perform a sparse checkout of items to import from a release repo --- import/importer.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/import/importer.groovy b/import/importer.groovy index 9620e8a..d85818f 100644 --- a/import/importer.groovy +++ b/import/importer.groovy @@ -81,7 +81,7 @@ def artifactimportfromrepo(meta, String repo, String revision, String destpath, def rootrevision = revision.trim() echo "Cloning root release repo: ${rooturl}, revision: ${rootrevision} at folder: ${destpath}" - def ArrayList sparseitemlist = gh.convertstringitemstopublish(filter) { + def ArrayList sparseitemlist = gh.convertstringitemstopublish(filter) gh.gitCheckoutAlt(rooturl, rootrevision, destpath, "", 1, true, sparseitemlist) def importedmeta = meta.importrelated(destpath) From a32fbee67b59dba3c928b67fe2aa80b1b838b101 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Thu, 23 May 2019 23:25:53 +0100 Subject: [PATCH 29/57] MCS-425 - Perform a sparse checkout of items to import from a release repo --- import/importer.groovy | 2 +- publish/do.groovy | 13 ------------- versioncontrol/git.groovy | 13 +++++++++++++ 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/import/importer.groovy b/import/importer.groovy index d85818f..764618c 100644 --- a/import/importer.groovy +++ b/import/importer.groovy @@ -81,7 +81,7 @@ def artifactimportfromrepo(meta, String repo, String revision, String destpath, def rootrevision = revision.trim() echo "Cloning root release repo: ${rooturl}, revision: ${rootrevision} at folder: ${destpath}" - def ArrayList sparseitemlist = gh.convertstringitemstopublish(filter) + def ArrayList sparseitemlist = gh.convertSparseItemsString(filter) gh.gitCheckoutAlt(rooturl, rootrevision, destpath, "", 1, true, sparseitemlist) def importedmeta = meta.importrelated(destpath) diff --git a/publish/do.groovy b/publish/do.groovy index 6207380..1599ca8 100644 --- a/publish/do.groovy +++ b/publish/do.groovy @@ -148,19 +148,6 @@ def convertitemstopublish(String itemstopublishstring) { return paths } -def convertstringitemstopublish(String itemstopublishstring) { - def List paths = [] - - def String[] items = itemstopublishstring.split(',') - def String allpaths = "" - for(String item : items) { - paths.add(item) - allpaths += "${path}\n" - } - echo "Selected item to publish:\n${allpaths}" - return paths -} - // Publish selected items from a release to the customer folder on the ftp site // itemstopublishstring is a comma-seperated set of strings in this format ## def publishhierarchy(releasemeta, String itemstopublishstring, String customer, String softwarerelease, String maxdepth) { diff --git a/versioncontrol/git.groovy b/versioncontrol/git.groovy index 534084d..818734a 100644 --- a/versioncontrol/git.groovy +++ b/versioncontrol/git.groovy @@ -246,6 +246,19 @@ def gitsparserestore(String targetDir) { } } +def List convertSparseItemsString(String itemstopublish) { + def List paths = [] + + def String[] items = itemstopublish.split(',') + def String allpaths = "" + for(String item : items) { + paths.add(item) + allpaths += "${path}\n" + } + echo "Selected item to publish:\n${allpaths}" + return paths +} + def gitCheckoutAlt(String gitURL, String revision, String targetDir, String repoRootSuffix = "", int cloneDepth = 1, boolean shallowClone = true, ArrayList sparseitemlist = new ArrayList()) { echo "Performing alternative checkout" def String reporootpath = lfsinstallandreporoot(gitURL) From 03046f5c04c23f17a14d6e46bac38d2bf71d4e70 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Thu, 23 May 2019 23:33:55 +0100 Subject: [PATCH 30/57] MCS-425 - Perform a sparse checkout of items to import from a release repo --- versioncontrol/git.groovy | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/versioncontrol/git.groovy b/versioncontrol/git.groovy index 818734a..811d072 100644 --- a/versioncontrol/git.groovy +++ b/versioncontrol/git.groovy @@ -247,16 +247,16 @@ def gitsparserestore(String targetDir) { } def List convertSparseItemsString(String itemstopublish) { - def List paths = [] + def List sparsepaths = [] def String[] items = itemstopublish.split(',') def String allpaths = "" for(String item : items) { - paths.add(item) - allpaths += "${path}\n" + sparsepaths.add(item) + allpaths += "${item}\n" } echo "Selected item to publish:\n${allpaths}" - return paths + return sparsepaths } def gitCheckoutAlt(String gitURL, String revision, String targetDir, String repoRootSuffix = "", int cloneDepth = 1, boolean shallowClone = true, ArrayList sparseitemlist = new ArrayList()) { From af12802f1b0661ffe15ba79dacfd058a8e1e0e6a Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Thu, 6 Jun 2019 13:30:15 +0100 Subject: [PATCH 31/57] One level of meta too high was being marked as released when importing an already released component (from a release repository) --- import/importer.groovy | 2 +- meta/folder.groovy | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/import/importer.groovy b/import/importer.groovy index 764618c..fd43379 100644 --- a/import/importer.groovy +++ b/import/importer.groovy @@ -68,7 +68,7 @@ def hierarchyartifactimportfromrepo(meta, String repo, String revision, String d gh.stripgithistory(destpath) def metafilepath = "${destpath}/${meta.metafilepath()}" echo "Marking root meta as released and rewriting meta file: ${metafilepath}" - rewritemetafileasreleased(meta, metafilepath) + rewritemetafileasreleased(importedmeta, metafilepath) if (incrementversionnumber) { meta.buildstampinfo.changerevision(versiongenerator.incrementrevision(meta.buildstampinfo.revision, importedmeta.buildstampinfo.revision)) diff --git a/meta/folder.groovy b/meta/folder.groovy index b16db5d..f8c033b 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -491,6 +491,7 @@ class MetaInfo extends GISJsonSerialised { } void markreleased() { + script.echo("Marking product: ${productinfo.productname} component: ${productinfo.subcomponentname} as released") releaseinfo.markreleased() for (associated in associatedmeta) { associated.meta.releaseinfo.markreleased() From 78f45274fa261ec1c0b7200a0e62835a9b2417a1 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Thu, 6 Jun 2019 14:08:13 +0100 Subject: [PATCH 32/57] One level of meta too high was being marked as released when importing an already released component (from a release repository) --- import/importer.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/import/importer.groovy b/import/importer.groovy index fd43379..09eb337 100644 --- a/import/importer.groovy +++ b/import/importer.groovy @@ -89,7 +89,7 @@ def artifactimportfromrepo(meta, String repo, String revision, String destpath, gh.stripgithistory(destpath) def metafilepath = "${destpath}/${meta.metafilepath()}" echo "Marking root meta as released and rewriting meta file: ${metafilepath}" - rewritemetafileasreleased(meta, metafilepath) + rewritemetafileasreleased(importedmeta, metafilepath) if (incrementversionnumber) { meta.buildstampinfo.changerevision(versiongenerator.incrementrevision(meta.buildstampinfo.revision, importedmeta.buildstampinfo.revision)) From 84ff4211df10e319bda246902649d5f99fe85b11 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Thu, 18 Jul 2019 11:22:06 +0100 Subject: [PATCH 33/57] Provide logging to debug why import of Print Server artifacts results in duff associated meta data --- meta/folder.groovy | 3 +++ 1 file changed, 3 insertions(+) diff --git a/meta/folder.groovy b/meta/folder.groovy index f8c033b..b559458 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -571,6 +571,7 @@ class MetaInfo extends GISJsonSerialised { } def deserialiseJson(String filepath) { + script.echo("Deserialising JSON at file: ${filepath}" def rawmeta = script.readJSON(file: filepath) deserialiseJson(rawmeta) } @@ -617,6 +618,8 @@ class MetaInfo extends GISJsonSerialised { def importedmetafile = adjustedpath + "/" + metafilepath() if (script.fileExists(importedmetafile)) { mi.deserialiseJson(importedmetafile) + } else { + script.echo("Could not deserialise meta at file: ${importedmetafile} (destpath: ${destpath})- Does not exist") } RelatedMetaInfo rmi = new RelatedMetaInfo(script, adjustedpath, mi) From 4ea4d19eaa1227e15ea2d92622fb7da288bb0ed7 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Thu, 18 Jul 2019 11:34:23 +0100 Subject: [PATCH 34/57] Provide logging to debug why import of Print Server artifacts results in duff associated meta data --- meta/folder.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta/folder.groovy b/meta/folder.groovy index b559458..ddc99c4 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -571,7 +571,7 @@ class MetaInfo extends GISJsonSerialised { } def deserialiseJson(String filepath) { - script.echo("Deserialising JSON at file: ${filepath}" + script.echo("Deserialising JSON at file: ${filepath}") def rawmeta = script.readJSON(file: filepath) deserialiseJson(rawmeta) } From dac329445c05a512a1502bc69808ca132ff28488 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Fri, 19 Jul 2019 13:43:21 +0100 Subject: [PATCH 35/57] Don't release a component if it is not available in the build job's artifacts --- release/do.groovy | 43 ++++++++++++++++++++++++++----------------- 1 file changed, 26 insertions(+), 17 deletions(-) diff --git a/release/do.groovy b/release/do.groovy index 738c04a..1898594 100644 --- a/release/do.groovy +++ b/release/do.groovy @@ -92,9 +92,10 @@ def checkoutsourcerepo(buildmeta, String checkoutfolder) { } } -def getcomponentartifacts(toplevelbuildmeta, buildinfo, String repofolder, String tempfolder) { +def boolean getcomponentartifacts(toplevelbuildmeta, buildinfo, String repofolder, String tempfolder) { // Copy relevant artifacts to temp folder summaryappend("Artifacts: ") + bool exceptionduringcopyartifacts = false for (artifactfilter in buildinfo.meta.releaseinfo.releaseitems) { def filterpath = artifactfilter if (buildinfo.offsetpath) { @@ -102,22 +103,30 @@ def getcomponentartifacts(toplevelbuildmeta, buildinfo, String repofolder, Strin } // Copy relevant artifacts to temp folder echo "Copying artifacts: ${filterpath} to ${tempfolder}" - copyArtifacts( - filter: filterpath, - projectName: toplevelbuildmeta.jenkinsbuildinfo.buildjobname, - selector: [ - $class: 'ParameterizedBuildSelector', - parameterName: "${toplevelbuildmeta.jenkinsbuildinfo.buildnumber}" - ], - target: tempfolder - ) - // Move relevant artifacts from temp folder to release position - def originalrootdir = tempfolder + "/" + buildinfo.offsetpath - dir(originalrootdir) { - sh("mv * ${repofolder}") + try { + copyArtifacts( + filter: filterpath, + projectName: toplevelbuildmeta.jenkinsbuildinfo.buildjobname, + selector: [ + $class: 'ParameterizedBuildSelector', + parameterName: "${toplevelbuildmeta.jenkinsbuildinfo.buildnumber}" + ], + target: tempfolder + ) + } catch (Exception e) { + echo "Exception occurred while copying artifacts from ${toplevelbuildmeta.jenkinsbuildinfo.buildjobname}: ${e.getMessage()}" + exceptionduringcopyartifacts = true + summaryappend("Does not exist: ${artifactfilter}," + } else { + // Move relevant artifacts from temp folder to release position + def originalrootdir = tempfolder + "/" + buildinfo.offsetpath + dir(originalrootdir) { + sh("mv * ${repofolder}") + } } summaryappend("${artifactfilter},") } + return exceptionduringcopyartifacts } def releasegitadd() { @@ -357,9 +366,9 @@ def releasecomponent(toplevelbuildmeta, buildinfo, String otherreleasetags, Stri checkoutsourcerepo(buildmeta, uniquefolderforsourcerepo) - getcomponentartifacts(toplevelbuildmeta, buildinfo, uniquefolderforrepo, uniquefoldertemp) - - gitrelease(buildmeta, previousreleasemeta, uniquefolderforrepo, uniquefolderforsourcerepo, otherreleasetags, dryrunpush) + if (getcomponentartifacts(toplevelbuildmeta, buildinfo, uniquefolderforrepo, uniquefoldertemp)) { + gitrelease(buildmeta, previousreleasemeta, uniquefolderforrepo, uniquefolderforsourcerepo, otherreleasetags, dryrunpush) + } summaryappend("\n") } From 32952f0677b254f66df6ec98a6ef2c5b28796ffe Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Fri, 19 Jul 2019 13:51:29 +0100 Subject: [PATCH 36/57] Don't release a component if it is not available in the build job's artifacts --- release/do.groovy | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/release/do.groovy b/release/do.groovy index 1898594..10fc165 100644 --- a/release/do.groovy +++ b/release/do.groovy @@ -117,7 +117,8 @@ def boolean getcomponentartifacts(toplevelbuildmeta, buildinfo, String repofolde echo "Exception occurred while copying artifacts from ${toplevelbuildmeta.jenkinsbuildinfo.buildjobname}: ${e.getMessage()}" exceptionduringcopyartifacts = true summaryappend("Does not exist: ${artifactfilter}," - } else { + } + if (!exceptionduringcopyartifacts) { // Move relevant artifacts from temp folder to release position def originalrootdir = tempfolder + "/" + buildinfo.offsetpath dir(originalrootdir) { From 152eb536a4ef826e5c183713ca29fcb5a940ccce Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Fri, 19 Jul 2019 13:53:31 +0100 Subject: [PATCH 37/57] Don't release a component if it is not available in the build job's artifacts --- release/do.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release/do.groovy b/release/do.groovy index 10fc165..c1c4277 100644 --- a/release/do.groovy +++ b/release/do.groovy @@ -116,7 +116,7 @@ def boolean getcomponentartifacts(toplevelbuildmeta, buildinfo, String repofolde } catch (Exception e) { echo "Exception occurred while copying artifacts from ${toplevelbuildmeta.jenkinsbuildinfo.buildjobname}: ${e.getMessage()}" exceptionduringcopyartifacts = true - summaryappend("Does not exist: ${artifactfilter}," + summaryappend("Does not exist: ${artifactfilter},") } if (!exceptionduringcopyartifacts) { // Move relevant artifacts from temp folder to release position From d52f4538de6630627a60b4106f9b4b2a92ede79e Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Fri, 19 Jul 2019 14:09:53 +0100 Subject: [PATCH 38/57] Don't release a component if it is not available in the build job's artifacts --- release/do.groovy | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/release/do.groovy b/release/do.groovy index c1c4277..0e7809e 100644 --- a/release/do.groovy +++ b/release/do.groovy @@ -95,7 +95,7 @@ def checkoutsourcerepo(buildmeta, String checkoutfolder) { def boolean getcomponentartifacts(toplevelbuildmeta, buildinfo, String repofolder, String tempfolder) { // Copy relevant artifacts to temp folder summaryappend("Artifacts: ") - bool exceptionduringcopyartifacts = false + boolean exceptionduringcopyartifacts = false for (artifactfilter in buildinfo.meta.releaseinfo.releaseitems) { def filterpath = artifactfilter if (buildinfo.offsetpath) { @@ -116,7 +116,7 @@ def boolean getcomponentartifacts(toplevelbuildmeta, buildinfo, String repofolde } catch (Exception e) { echo "Exception occurred while copying artifacts from ${toplevelbuildmeta.jenkinsbuildinfo.buildjobname}: ${e.getMessage()}" exceptionduringcopyartifacts = true - summaryappend("Does not exist: ${artifactfilter},") + summaryappend("Does not exist:") } if (!exceptionduringcopyartifacts) { // Move relevant artifacts from temp folder to release position From bf72927c93ee67dba6c2871de449ab99f2503931 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Fri, 19 Jul 2019 14:33:01 +0100 Subject: [PATCH 39/57] Don't release a component if it is not available in the build job's artifacts --- release/do.groovy | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/release/do.groovy b/release/do.groovy index 0e7809e..1b21bcf 100644 --- a/release/do.groovy +++ b/release/do.groovy @@ -95,7 +95,7 @@ def checkoutsourcerepo(buildmeta, String checkoutfolder) { def boolean getcomponentartifacts(toplevelbuildmeta, buildinfo, String repofolder, String tempfolder) { // Copy relevant artifacts to temp folder summaryappend("Artifacts: ") - boolean exceptionduringcopyartifacts = false + def boolean result = true for (artifactfilter in buildinfo.meta.releaseinfo.releaseitems) { def filterpath = artifactfilter if (buildinfo.offsetpath) { @@ -115,10 +115,10 @@ def boolean getcomponentartifacts(toplevelbuildmeta, buildinfo, String repofolde ) } catch (Exception e) { echo "Exception occurred while copying artifacts from ${toplevelbuildmeta.jenkinsbuildinfo.buildjobname}: ${e.getMessage()}" - exceptionduringcopyartifacts = true + result = false summaryappend("Does not exist:") } - if (!exceptionduringcopyartifacts) { + if (result) { // Move relevant artifacts from temp folder to release position def originalrootdir = tempfolder + "/" + buildinfo.offsetpath dir(originalrootdir) { @@ -127,7 +127,7 @@ def boolean getcomponentartifacts(toplevelbuildmeta, buildinfo, String repofolde } summaryappend("${artifactfilter},") } - return exceptionduringcopyartifacts + return result } def releasegitadd() { From b32a5116dd657f59b30ef079c6bc9c1056833796 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Fri, 25 Oct 2019 16:18:19 +0100 Subject: [PATCH 40/57] GIS-1621 - Remove local diffing (superceded); Add as much git info to a meta object when it is not being provided - for old jobs not providing meta information --- configuration/configuration.groovy | 2 +- differences/do.groovy | 18 ------------------ import/importer.groovy | 4 ++-- meta/folder.groovy | 25 ++----------------------- 4 files changed, 5 insertions(+), 44 deletions(-) delete mode 100644 differences/do.groovy diff --git a/configuration/configuration.groovy b/configuration/configuration.groovy index b8c0b47..2a7f1ab 100644 --- a/configuration/configuration.groovy +++ b/configuration/configuration.groovy @@ -5,7 +5,7 @@ def registerConfigurationInfo(meta, String configurationName, String configurati } def registerPipelineScriptConfiguration(meta) { - registerConfigurationInfo(meta, 'pipeline script', '-', '-', gh.getGitInfo("${autobuilder.getautobuildpath()}")) + registerConfigurationInfo(meta, 'pipeline script', '-', '-', 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 = '') { diff --git a/differences/do.groovy b/differences/do.groovy deleted file mode 100644 index 32f18b5..0000000 --- a/differences/do.groovy +++ /dev/null @@ -1,18 +0,0 @@ - -def differences(meta, String sourcerevision, String previoussourcerevision, String sourcepath) { - def String cs = autobuilder.commonscripts() - def String difffile = meta.difffilepath() - def String jirakey = meta.productinfo.jirakey - if (isUnix()) { - sh """ - "${PYTHON}" -u "${cs}/differences/show_release_differences.py" -g "${sourcepath}" -s "${sourcerevision}" -p "${previoussourcerevision}" -j "${jirakey}" -o "opposite notcommon" -f "${difffile}" - """ - } - else { - bat """ - "${PYTHON}" -u "${cs}\\differences\\show_release_differences.py" -g "${sourcepath}" -s "${sourcerevision}" -p "${previoussourcerevision}" -j "${jirakey}" -o "opposite notcommon" -f "${difffile}" - """ - } -} - -return this; diff --git a/import/importer.groovy b/import/importer.groovy index ba5eb0b..78c0d62 100644 --- a/import/importer.groovy +++ b/import/importer.groovy @@ -51,7 +51,7 @@ def hierarchyartifactimportfromrepo(meta, String repo, String revision, String d def ArrayList sparseitemlist = gh.convertSparseItemsString(filter) gh.gitCheckoutAlt(rooturl, rootrevision, destpath, "", 1, true, sparseitemlist) - def importedmeta = meta.importrelated(destpath) + def importedmeta = meta.importrelated(destpath, rooturl, rootrevision, gh.getGitInfo(destpath)) relatedimportinfo = importedmeta.getassociated() echo "Cloning associated repos" @@ -90,7 +90,7 @@ def artifactimportfromrepo(meta, String repo, String revision, String destpath, def ArrayList sparseitemlist = gh.convertSparseItemsString(filter) gh.gitCheckoutAlt(rooturl, rootrevision, destpath, "", 1, true, sparseitemlist) - def importedmeta = meta.importrelated(destpath) + def importedmeta = meta.importrelated(destpath, rooturl, rootrevision, gh.getGitInfo(destpath)) gh.stripgithistory(destpath) def metafilepath = "${destpath}/${meta.metafilepath()}" diff --git a/meta/folder.groovy b/meta/folder.groovy index 6967def..6371f38 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -429,11 +429,8 @@ class PublishableInfo extends GISJsonSerialised { class MetaInfo extends GISJsonSerialised { private static String FORMAT = "0.1" private static String METAFOLDERNAME = "meta" - private static String DIFFFOLDERNAME = "diff" private static String METAFILENAME = "info.json" - private static String METADIFFFILENAME = "differences.txt" private static String METAARTIFACTS = "${METAFOLDERNAME}/**" - private static String DIFFARTIFACTS = "${DIFFFOLDERNAME}/**" class RelatedMetaInfo extends GISJsonSerialised { String offsetpath @@ -607,11 +604,7 @@ class MetaInfo extends GISJsonSerialised { return METAFOLDERNAME + "/" + METAFILENAME } - static String difffilepath() { - return DIFFFOLDERNAME + "/" + METADIFFFILENAME - } - - MetaInfo importrelated(String destpath) { + MetaInfo importrelated(String destpath, String givenRepo = 'Unknown', String givenRevision = 'Unknown', String givenSHA = 'Unknown') { MetaInfo mi = new MetaInfo(script) def String adjustedpath = relativize(destpath) @@ -620,22 +613,12 @@ class MetaInfo extends GISJsonSerialised { mi.deserialiseJson(importedmetafile) } else { script.echo("Could not deserialise meta at file: ${importedmetafile} (destpath: ${destpath})- Does not exist") + mi.addConfigurationInfo('', givenRepo, givenRevision, givenSHA) } RelatedMetaInfo rmi = new RelatedMetaInfo(script, adjustedpath, mi) associatedmeta.add(rmi) - def importedmetadifffile = adjustedpath + "/" + difffilepath() - if (script.fileExists(importedmetadifffile)) { - def String newcontents = script.readFile(file: importedmetadifffile) - def String currentcontents = "" - if (script.fileExists(difffilepath())) { - currentcontents = script.readFile(file: difffilepath()) - } - - script.writeFile(file: difffilepath(), text: currentcontents + "\n" + mi.productinfo.productname + " " + mi.productinfo.subcomponentname + ":\n" + newcontents) - } - return mi } @@ -660,10 +643,6 @@ class MetaInfo extends GISJsonSerialised { return METAFOLDERNAME } - static String difffolder() { - return DIFFFOLDERNAME - } - String generateartifacts(ArrayList releasedfromhere = new ArrayList(), // These items are recorded in meta as released from here ArrayList releasedfromsubmeta = new ArrayList(), // These items are not recorded in meta as released from here String metafilepath ="${METAFOLDERNAME}/${METAFILENAME}" From f6a55441cf4edca1b789332df255a59ae3979843 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Fri, 25 Oct 2019 16:20:57 +0100 Subject: [PATCH 41/57] GIS-1621 - Remove local diffing (superceded); Add as much git info to a meta object when it is not being provided - for old jobs not providing meta information --- meta/folder.groovy | 4 ---- 1 file changed, 4 deletions(-) diff --git a/meta/folder.groovy b/meta/folder.groovy index 6371f38..2e142a2 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -756,10 +756,6 @@ MetaInfo metareset(script) { deleteDir() } - dir(mi.difffolder()) { - deleteDir() - } - return mi } From a13f11435b7dec72fe8a98a2838b6995ec890f5a Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Fri, 25 Oct 2019 16:59:55 +0100 Subject: [PATCH 42/57] GIS-1621 - Remove local diffing (superceded); Add as much git info to a meta object when it is not being provided - for old jobs not providing meta information --- meta/folder.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta/folder.groovy b/meta/folder.groovy index 2e142a2..e5f34f0 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -647,7 +647,7 @@ class MetaInfo extends GISJsonSerialised { ArrayList releasedfromsubmeta = new ArrayList(), // These items are not recorded in meta as released from here String metafilepath ="${METAFOLDERNAME}/${METAFILENAME}" ) { - def String artifactlist = "${METAARTIFACTS},${DIFFARTIFACTS}" + def String artifactlist = METAARTIFACTS releaseinfo.addReleaseItem(METAARTIFACTS) for (releaseitem in releasedfromhere) { artifactlist += "," + releaseitem From d0ed9310fc8502e8153cc8277341f734368c620c Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Thu, 7 Nov 2019 09:11:10 +0000 Subject: [PATCH 43/57] GIS-1621 - Be selective with releases - don't show those with tags beginning with erroneous_ superceded_ faulty_ inmainline_ unless SHOWALL parameter is true --- publish/promptingpublish.groovy | 16 +++++++++++++++- publish/publishitems.groovy | 2 +- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/publish/promptingpublish.groovy b/publish/promptingpublish.groovy index ced73a2..670501d 100644 --- a/publish/promptingpublish.groovy +++ b/publish/promptingpublish.groovy @@ -53,7 +53,21 @@ pipeline { steps { script { gh = load("${autobuilder.commonscripts()}/versioncontrol/git.groovy") - def releases = gh.gettaglist(SOURCEDIR) + def allreleases = gh.gettaglist(SOURCEDIR) + showall = SHOWALL ?: 'false' + def releases + if (showall) { + releases = allreleases + } else { + for (release in allreleases) { + if (!release.toLowerCase().startsWith("superceded_") && + !release.toLowerCase().startsWith("erroneous_") && + !release.toLowerCase().startsWith("faulty_") && + !release.toLowerCase().startsWith("inmainline_")) { + releases.append(release) + } + } + } timeout(time: 10, unit: 'MINUTES') { release = input( message: 'Please select the software version', diff --git a/publish/publishitems.groovy b/publish/publishitems.groovy index d84123d..677970e 100644 --- a/publish/publishitems.groovy +++ b/publish/publishitems.groovy @@ -124,4 +124,4 @@ PublishableItemsSelection createItemSelector( return pis } -return this; \ No newline at end of file +return this; From 1f55e79acfa5989183c409e7e6d8f60ee96ed57b Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Thu, 7 Nov 2019 09:22:23 +0000 Subject: [PATCH 44/57] GIS-1621 - Be selective with releases - don't show those with tags beginning with erroneous_ superceded_ faulty_ inmainline_ unless SHOWALL parameter is true --- publish/promptingpublish.groovy | 1 + 1 file changed, 1 insertion(+) diff --git a/publish/promptingpublish.groovy b/publish/promptingpublish.groovy index 670501d..fb312f0 100644 --- a/publish/promptingpublish.groovy +++ b/publish/promptingpublish.groovy @@ -63,6 +63,7 @@ pipeline { if (!release.toLowerCase().startsWith("superceded_") && !release.toLowerCase().startsWith("erroneous_") && !release.toLowerCase().startsWith("faulty_") && + !release.toLowerCase().startsWith("ignore_") && !release.toLowerCase().startsWith("inmainline_")) { releases.append(release) } From fc3d611c844ed2219061aae4d2fd4b5cde7f2398 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Thu, 7 Nov 2019 09:45:09 +0000 Subject: [PATCH 45/57] GIS-1621 - Be selective with releases - don't show those with tags beginning with erroneous_ superceded_ faulty_ inmainline_ unless SHOWALL parameter is true --- publish/promptingpublish.groovy | 2 ++ 1 file changed, 2 insertions(+) diff --git a/publish/promptingpublish.groovy b/publish/promptingpublish.groovy index fb312f0..6950754 100644 --- a/publish/promptingpublish.groovy +++ b/publish/promptingpublish.groovy @@ -55,11 +55,13 @@ pipeline { gh = load("${autobuilder.commonscripts()}/versioncontrol/git.groovy") def allreleases = gh.gettaglist(SOURCEDIR) showall = SHOWALL ?: 'false' + echo("showall: ${showall} ${SHOWALL}") def releases if (showall) { releases = allreleases } else { for (release in allreleases) { + echo("Evaluating: |${release}|") if (!release.toLowerCase().startsWith("superceded_") && !release.toLowerCase().startsWith("erroneous_") && !release.toLowerCase().startsWith("faulty_") && From 6ce20315af1d097c90e5bbfbfe51c6e1192c1520 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Thu, 7 Nov 2019 09:47:59 +0000 Subject: [PATCH 46/57] GIS-1621 - Be selective with releases - don't show those with tags beginning with erroneous_ superceded_ faulty_ inmainline_ unless SHOWALL parameter is true --- publish/promptingpublish.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/publish/promptingpublish.groovy b/publish/promptingpublish.groovy index 6950754..80dc633 100644 --- a/publish/promptingpublish.groovy +++ b/publish/promptingpublish.groovy @@ -54,7 +54,7 @@ pipeline { script { gh = load("${autobuilder.commonscripts()}/versioncontrol/git.groovy") def allreleases = gh.gettaglist(SOURCEDIR) - showall = SHOWALL ?: 'false' + boolean showall = (SHOWALL == 'true') echo("showall: ${showall} ${SHOWALL}") def releases if (showall) { From 1bd181cd0b3f0ca44d0d61f67c7b73c08e335d5b Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Thu, 7 Nov 2019 09:50:30 +0000 Subject: [PATCH 47/57] GIS-1621 - Be selective with releases - don't show those with tags beginning with erroneous_ superceded_ faulty_ inmainline_ unless SHOWALL parameter is true --- publish/promptingpublish.groovy | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/publish/promptingpublish.groovy b/publish/promptingpublish.groovy index 80dc633..bf95bb2 100644 --- a/publish/promptingpublish.groovy +++ b/publish/promptingpublish.groovy @@ -55,8 +55,7 @@ pipeline { gh = load("${autobuilder.commonscripts()}/versioncontrol/git.groovy") def allreleases = gh.gettaglist(SOURCEDIR) boolean showall = (SHOWALL == 'true') - echo("showall: ${showall} ${SHOWALL}") - def releases + def releases = new ArrayList() if (showall) { releases = allreleases } else { From 3e27e84050ddd73e8b852970a23c4b6a034962da Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Thu, 7 Nov 2019 09:53:52 +0000 Subject: [PATCH 48/57] GIS-1621 - Be selective with releases - don't show those with tags beginning with erroneous_ superceded_ faulty_ inmainline_ unless SHOWALL parameter is true --- publish/promptingpublish.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/publish/promptingpublish.groovy b/publish/promptingpublish.groovy index bf95bb2..d8d5303 100644 --- a/publish/promptingpublish.groovy +++ b/publish/promptingpublish.groovy @@ -66,7 +66,7 @@ pipeline { !release.toLowerCase().startsWith("faulty_") && !release.toLowerCase().startsWith("ignore_") && !release.toLowerCase().startsWith("inmainline_")) { - releases.append(release) + releases.add(release) } } } From d5ab89e81edbc4d984bebcc026ec7a1b67d1b703 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Thu, 7 Nov 2019 09:55:55 +0000 Subject: [PATCH 49/57] GIS-1621 - Be selective with releases - don't show those with tags beginning with erroneous_ superceded_ faulty_ inmainline_ unless SHOWALL parameter is true --- publish/promptingpublish.groovy | 1 - 1 file changed, 1 deletion(-) diff --git a/publish/promptingpublish.groovy b/publish/promptingpublish.groovy index d8d5303..f2372cd 100644 --- a/publish/promptingpublish.groovy +++ b/publish/promptingpublish.groovy @@ -60,7 +60,6 @@ pipeline { releases = allreleases } else { for (release in allreleases) { - echo("Evaluating: |${release}|") if (!release.toLowerCase().startsWith("superceded_") && !release.toLowerCase().startsWith("erroneous_") && !release.toLowerCase().startsWith("faulty_") && From 15f4c4acd3800602327f91f082cb08653e6b0c08 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Thu, 7 Nov 2019 17:39:56 +0000 Subject: [PATCH 50/57] GIS-1621 - Add some output to debug why configuration information is not being added to imported logic meta --- import/importer.groovy | 4 ++-- meta/folder.groovy | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/import/importer.groovy b/import/importer.groovy index 78c0d62..25b2614 100644 --- a/import/importer.groovy +++ b/import/importer.groovy @@ -85,7 +85,7 @@ def hierarchyartifactimportfromrepo(meta, String repo, String revision, String d def artifactimportfromrepo(meta, String repo, String revision, String destpath, boolean incrementversionnumber = true, String filter = '', String excludes = '', boolean fingerprint = false) { def rooturl = repo.trim() def rootrevision = revision.trim() - echo "Cloning root release repo: ${rooturl}, revision: ${rootrevision} at folder: ${destpath}" + echo "Cloning release repo: ${rooturl}, revision: ${rootrevision} at folder: ${destpath}" def ArrayList sparseitemlist = gh.convertSparseItemsString(filter) gh.gitCheckoutAlt(rooturl, rootrevision, destpath, "", 1, true, sparseitemlist) @@ -94,7 +94,7 @@ def artifactimportfromrepo(meta, String repo, String revision, String destpath, gh.stripgithistory(destpath) def metafilepath = "${destpath}/${meta.metafilepath()}" - echo "Marking root meta as released and rewriting meta file: ${metafilepath}" + echo "Marking meta as released and rewriting meta file: ${metafilepath}" rewritemetafileasreleased(importedmeta, metafilepath) if (incrementversionnumber) { diff --git a/meta/folder.groovy b/meta/folder.groovy index e5f34f0..40f03aa 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -511,6 +511,7 @@ class MetaInfo extends GISJsonSerialised { void addConfigurationInfo(String configurationname, String configurationURL, String configurationversion, String configurationSHA) { 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) } From a006c13b6280e72626dad107020906361787383e Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Fri, 8 Nov 2019 17:44:18 +0000 Subject: [PATCH 51/57] GIS-1621 - Debug release filtering --- publish/promptingpublish.groovy | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/publish/promptingpublish.groovy b/publish/promptingpublish.groovy index f2372cd..6f0a6a5 100644 --- a/publish/promptingpublish.groovy +++ b/publish/promptingpublish.groovy @@ -54,17 +54,20 @@ pipeline { script { gh = load("${autobuilder.commonscripts()}/versioncontrol/git.groovy") def allreleases = gh.gettaglist(SOURCEDIR) - boolean showall = (SHOWALL == 'true') + boolean filterredundantreleases = (FILTER_REDUNDANT_RELEASES == 'true') def releases = new ArrayList() - if (showall) { + if (!filterredundantreleases) { + echo("Showing all releases") releases = allreleases } else { + echo("Showing filtered releases") for (release in allreleases) { if (!release.toLowerCase().startsWith("superceded_") && !release.toLowerCase().startsWith("erroneous_") && !release.toLowerCase().startsWith("faulty_") && !release.toLowerCase().startsWith("ignore_") && !release.toLowerCase().startsWith("inmainline_")) { + echo("Showing release: ${release}") releases.add(release) } } From 29bd0eafc6d2df94d8d5d9e6cd9a372bbb5d11af Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sat, 9 Nov 2019 00:41:41 +0000 Subject: [PATCH 52/57] GIS-1621 - Show origin just before pushing tags --- release/do.groovy | 1 + 1 file changed, 1 insertion(+) diff --git a/release/do.groovy b/release/do.groovy index 1b21bcf..ee1bdf5 100644 --- a/release/do.groovy +++ b/release/do.groovy @@ -274,6 +274,7 @@ def releasegitpush(String dryrunpush ) { } def sourcegitpush(String dryrunpush ) { + sh("git remote -v") if (dryrunpush == "true") { sh("git push -n --tags") summaryappend(",Src-Dry-Run-Push") From 4e45329fe1c127ee158757295f45f97823bdadae Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sat, 9 Nov 2019 07:58:41 +0000 Subject: [PATCH 53/57] GIS-1621 - Show origin just before pushing tags --- release/do.groovy | 1 + 1 file changed, 1 insertion(+) diff --git a/release/do.groovy b/release/do.groovy index ee1bdf5..a9f0a3e 100644 --- a/release/do.groovy +++ b/release/do.groovy @@ -262,6 +262,7 @@ def sourcegittags(String buildsha, List taglist) { } def releasegitpush(String dryrunpush ) { + sh("git remote -v") if (dryrunpush == "true") { sh("git push -n --tags origin master") summaryappend(",Dry-Run-Push") From da6b830e8cc068a105ac89e3cb5905ee16fc16c4 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sat, 9 Nov 2019 08:03:23 +0000 Subject: [PATCH 54/57] GIS-1621 - Debug release filtering --- publish/promptingpublish.groovy | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/publish/promptingpublish.groovy b/publish/promptingpublish.groovy index 6f0a6a5..29e9bfd 100644 --- a/publish/promptingpublish.groovy +++ b/publish/promptingpublish.groovy @@ -62,11 +62,11 @@ pipeline { } else { echo("Showing filtered releases") for (release in allreleases) { - if (!release.toLowerCase().startsWith("superceded_") && - !release.toLowerCase().startsWith("erroneous_") && - !release.toLowerCase().startsWith("faulty_") && - !release.toLowerCase().startsWith("ignore_") && - !release.toLowerCase().startsWith("inmainline_")) { + if (!release.toLowerCase().startsWith("superceded") && + !release.toLowerCase().startsWith("erroneous") && + !release.toLowerCase().startsWith("faulty") && + !release.toLowerCase().startsWith("ignore") && + !release.toLowerCase().startsWith("inmainline")) { echo("Showing release: ${release}") releases.add(release) } From 6b5490069869ca03c4284a2eaa1e39b7574a9558 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sat, 9 Nov 2019 08:08:42 +0000 Subject: [PATCH 55/57] GIS-1621 - Debug release filtering --- publish/promptingpublish.groovy | 2 ++ 1 file changed, 2 insertions(+) diff --git a/publish/promptingpublish.groovy b/publish/promptingpublish.groovy index 29e9bfd..80305ab 100644 --- a/publish/promptingpublish.groovy +++ b/publish/promptingpublish.groovy @@ -69,6 +69,8 @@ pipeline { !release.toLowerCase().startsWith("inmainline")) { echo("Showing release: ${release}") releases.add(release) + } else { + echo("Not showing release: ${release}") } } } From f64c71e0cd54074f5f941a465619712ed52e547c Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sat, 9 Nov 2019 08:53:13 +0000 Subject: [PATCH 56/57] GIS-1621 - Remove publish filter debug log --- publish/promptingpublish.groovy | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/publish/promptingpublish.groovy b/publish/promptingpublish.groovy index 80305ab..c0e4837 100644 --- a/publish/promptingpublish.groovy +++ b/publish/promptingpublish.groovy @@ -54,9 +54,9 @@ pipeline { script { gh = load("${autobuilder.commonscripts()}/versioncontrol/git.groovy") def allreleases = gh.gettaglist(SOURCEDIR) - boolean filterredundantreleases = (FILTER_REDUNDANT_RELEASES == 'true') + boolean filterredundantreleases = def releases = new ArrayList() - if (!filterredundantreleases) { + if (FILTER_REDUNDANT_RELEASES == 'false') { echo("Showing all releases") releases = allreleases } else { @@ -67,10 +67,10 @@ pipeline { !release.toLowerCase().startsWith("faulty") && !release.toLowerCase().startsWith("ignore") && !release.toLowerCase().startsWith("inmainline")) { - echo("Showing release: ${release}") + //echo("Showing release: ${release}") releases.add(release) } else { - echo("Not showing release: ${release}") + //echo("Not showing release: ${release}") } } } From 0958de510814aa41340c8edf15d37d03e3f26ed3 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sat, 9 Nov 2019 09:16:06 +0000 Subject: [PATCH 57/57] GIS-1621 - Remove publish filter debug log --- publish/promptingpublish.groovy | 1 - 1 file changed, 1 deletion(-) diff --git a/publish/promptingpublish.groovy b/publish/promptingpublish.groovy index c0e4837..9f2d7dc 100644 --- a/publish/promptingpublish.groovy +++ b/publish/promptingpublish.groovy @@ -54,7 +54,6 @@ pipeline { script { gh = load("${autobuilder.commonscripts()}/versioncontrol/git.groovy") def allreleases = gh.gettaglist(SOURCEDIR) - boolean filterredundantreleases = def releases = new ArrayList() if (FILTER_REDUNDANT_RELEASES == 'false') { echo("Showing all releases")