From 25496a4c747d36ef45c2dc0799fd16223551d611 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 21 Jan 2020 16:36:16 +0000 Subject: [PATCH 1/7] Remove redundant parameter; Use latest api --- publish/publish.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/publish/publish.groovy b/publish/publish.groovy index 5750275..7beb134 100644 --- a/publish/publish.groovy +++ b/publish/publish.groovy @@ -5,7 +5,7 @@ pipeline { steps { script { autobuilderscript = load("${WORKSPACE}/autobuild/Common_scripts/autobuilder.groovy") - meta = autobuilderscript.start(this, PRODUCT_NAME, SUBCOMPONENT_NAME, JIRA_KEY, RELEASE_REPO) + meta = autobuilderscript.startbuild(this, PRODUCT_NAME, SUBCOMPONENT_NAME, RELEASE_REPO) } } } From 9f00d3420bdb0468288f238548769fa74c99adc8 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Wed, 5 Feb 2020 20:46:06 +0000 Subject: [PATCH 2/7] Stop using deprecated API --- publish/publish.groovy | 2 +- release/release.groovy | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/publish/publish.groovy b/publish/publish.groovy index 5750275..7beb134 100644 --- a/publish/publish.groovy +++ b/publish/publish.groovy @@ -5,7 +5,7 @@ pipeline { steps { script { autobuilderscript = load("${WORKSPACE}/autobuild/Common_scripts/autobuilder.groovy") - meta = autobuilderscript.start(this, PRODUCT_NAME, SUBCOMPONENT_NAME, JIRA_KEY, RELEASE_REPO) + meta = autobuilderscript.startbuild(this, PRODUCT_NAME, SUBCOMPONENT_NAME, RELEASE_REPO) } } } diff --git a/release/release.groovy b/release/release.groovy index 79c0234..a265c5b 100644 --- a/release/release.groovy +++ b/release/release.groovy @@ -5,7 +5,7 @@ pipeline { steps { script { autobuilderscript = load("${WORKSPACE}/autobuild/Common_scripts/autobuilder.groovy") - meta = autobuilderscript.start(this, PRODUCT_NAME, SUBCOMPONENT_NAME, JIRA_KEY, RELEASE_REPO) + meta = autobuilderscript.startbuild(this, PRODUCT_NAME, SUBCOMPONENT_NAME, RELEASE_REPO) } } } From 44b189c724a028ac71da0ca1b5857ad672ac4094 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Fri, 21 Feb 2020 05:52:17 +0000 Subject: [PATCH 3/7] Add filtered copy --- copy/filtered.groovy | 70 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 copy/filtered.groovy diff --git a/copy/filtered.groovy b/copy/filtered.groovy new file mode 100644 index 0000000..feaa2ab --- /dev/null +++ b/copy/filtered.groovy @@ -0,0 +1,70 @@ +pipeline { + agent { label AGENT_LABEL } + stages { + stage('Initial setup') { + steps { + script { + meta = load("${WORKSPACE}/autobuild/Common_scripts/autobuilder.groovy").startnonbuild(this) + + importer = load("${autobuilder.commonscripts()}/import/importer.groovy") + } + } + } + stage('Clean') { + steps { + script { + env.IMPORT = "${WORKSPACE}/import" + env.FILTEREDDEST = "${WORKSPACE}/filtered" + cleanfolders = [ + FILTEREDDEST, + IMPORT, + ] + cleaner = load("${autobuilder.commonscripts()}/clean/clean.groovy") + cleaner.clean(cleanfolders) + } + } + } + stage('Import artifacts') { + steps { + script { + importer.artifactimport(meta, ARTIFACT_LOCATION, ARTIFACT_PROJECT, ARTIFACT_BUILD_SELECTOR, RELEASE_REPO, RELEASE_REVISION, IMPORT) + } + } + } + stage('Filtered copy') { + steps { + script { + dir(IMPORT) { + fileOperations([ + fileCopyOperation(excludes: EXCLUDES, + flattenFiles: FLATTENOUTPUT, + includes: INCLUDES, + targetLocation: FILTEREDDEST)]) + } + } + } + } + stage('Archiving artifacts') { + steps { + script { + def artifactlist = meta.generateartifacts(["filtered/**"]) + archiveArtifacts "${artifactlist}" + } + } + } + } + post { + always { + echo 'Post-build' + } + failure { + echo 'Failed build' + } + unstable { + echo 'Unstable build' + } + success { + echo 'Succeeded build' + } + } +} From fbbabf9ffc71f4b7d813b86e8f42ebcaffb981ed Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 25 Feb 2020 08:56:26 +0000 Subject: [PATCH 4/7] Give out sha code info during release to git errors --- release/do.groovy | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/release/do.groovy b/release/do.groovy index 817fd5f..9e04208 100644 --- a/release/do.groovy +++ b/release/do.groovy @@ -213,7 +213,7 @@ def boolean releasegittag(String postcommitshacode, String tag) { if (existingshacode) { // Tag exists if (existingshacode != postcommitshacode) { // If the existing tag is not associated with HEAD // This is a problem - The tag is already at another position in git repo - setunstable("The release tag ${tag} has been used at another commit other than HEAD - You must decide what to do with it - Not good practice to delete it or move it") + setunstable("The release tag ${tag} has been used at another commit other than HEAD - You must decide what to do with it - Not good practice to delete it or move it (Existing sha code: ${existingshacode} Post commit sha code: ${postcommitshacode})") summaryappend("(${tag} - Could not add!)") } else { summaryappend("(${tag} - Already added)") @@ -247,7 +247,7 @@ def boolean sourcegittag(String shacode, String tag) { def existingshacode = readFile(file: gitrevparseoutputfile).trim() if (existingshacode != shacode) { // If the existing tag is not associated with HEAD // This is a problem - The tag is already at another position in git repo - setunstable("The source tag ${tag} has been used at another commit (${existingshacode}) - You must decide what to do with it - Not good practice to delete it or move it") + setunstable("The source tag ${tag} has been used at another commit (${existingshacode}) - You must decide what to do with it - Not good practice to delete it or move it (Existing sha code: ${existingshacode} Post commit sha code: ${shacode})") summaryappend("(${tag} - Could not add!)") } else { From c1e89e5739ee2eefb5ca9ca2ba78ff4312dfde80 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 25 Feb 2020 11:20:32 +0000 Subject: [PATCH 5/7] Alter warning message --- release/do.groovy | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/release/do.groovy b/release/do.groovy index 9e04208..3221d25 100644 --- a/release/do.groovy +++ b/release/do.groovy @@ -211,9 +211,9 @@ def boolean releasegittag(String postcommitshacode, String tag) { // Check if tag exists already def String existingshacode = releasegitgetshacode(tag) if (existingshacode) { // Tag exists - if (existingshacode != postcommitshacode) { // If the existing tag is not associated with HEAD + if (existingshacode != postcommitshacode) { // If the existing tag is not associated with the one expected // This is a problem - The tag is already at another position in git repo - setunstable("The release tag ${tag} has been used at another commit other than HEAD - You must decide what to do with it - Not good practice to delete it or move it (Existing sha code: ${existingshacode} Post commit sha code: ${postcommitshacode})") + setunstable("The release tag ${tag} has been used at another commit other than one expected - You must decide what to do with it - Not good practice to delete it or move it (Existing sha code: ${existingshacode} Post commit sha code: ${postcommitshacode})") summaryappend("(${tag} - Could not add!)") } else { summaryappend("(${tag} - Already added)") From e5d12351bd80493ac89733f1a9208312fafb7abb Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Wed, 26 Feb 2020 08:52:29 +0000 Subject: [PATCH 6/7] Display build parameters --- autobuilder.groovy | 2 ++ 1 file changed, 2 insertions(+) diff --git a/autobuilder.groovy b/autobuilder.groovy index 1256394..ccc32c1 100644 --- a/autobuilder.groovy +++ b/autobuilder.groovy @@ -40,12 +40,14 @@ def startbuild(script, String productname = PRODUCT_NAME, String subcomponentnam conditionalclean() def meta = getmetafolderscript().metareset(script) + echo "Product name: ${productname} Subcomponent name: ${subcomponentname}" meta.productinfo.set(productname, subcomponentname) def now = new Date() now.format("yyMMdd.HHmm", TimeZone.getTimeZone('UTC')) meta.jenkinsbuildinfo.set(JOB_NAME, BUILD_ID.toInteger(), NODE_NAME, now.toString()) def rr = load("${commonscripts()}/release/registerrepo.groovy") + echo "Release repo: ${releaserepo}" rr.registerrepo(meta, releaserepo) def ch = load("${commonscripts()}/configuration/configuration.groovy") From 701621af722d74310ff3d6e4ce7f45089886308e Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sun, 1 Mar 2020 11:57:14 +0000 Subject: [PATCH 7/7] Remove @Grab command as it is causing the ftpclient jobs to explode --- remoteaccess/ftp.groovy | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/remoteaccess/ftp.groovy b/remoteaccess/ftp.groovy index bdc441f..25b9143 100644 --- a/remoteaccess/ftp.groovy +++ b/remoteaccess/ftp.groovy @@ -1,4 +1,3 @@ -@Grab(group='commons-net', module='commons-net', version='2.0') import org.apache.commons.net.ftp.FTPClient class FTPSiteInfo { @@ -30,4 +29,4 @@ FTPClient createFTPClient(FTPSiteInfo ftpsiteinfo) { return ftpclient } -return this; \ No newline at end of file +return this;