From 21c59682a1976ee78a41222bdbcbdd27be736866 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Fri, 13 Dec 2019 14:32:32 +0000 Subject: [PATCH 1/3] GIS-1621 - Make an ESW copier job script --- copy/esw.groovy | 63 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 copy/esw.groovy diff --git a/copy/esw.groovy b/copy/esw.groovy new file mode 100644 index 0000000..2a63171 --- /dev/null +++ b/copy/esw.groovy @@ -0,0 +1,63 @@ +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 exports') { + steps { + script { + env.ESW = 'esw' + env.ESWDEST = "${WORKSPACE}/${ESW}" + env.ESWEXPORT = 'embedded_software' + cleanfolders = [ + ESWDEST, + ESWEXPORT, + ] + cleaner = load("${autobuilder.commonscripts()}/clean/clean.groovy") + cleaner.clean(cleanfolders) + } + } + } + stage('Copying embedded software artifacts') { + steps { + script { + importer.artifactimport(meta, ESW_ARTIFACT_LOCATION, ESW_ARTIFACT_BUILD_JOB, ESW_ARTIFACT_BUILD_SELECTOR, ESW_ARTIFACT_RELEASE_REPO, ESW_ARTIFACT_RELEASE_REVISION, ESWDEST) + } + } + } + stage('Archiving artifacts') { + steps { + script { + def artifactlist = meta.generateartifacts(["${ESWEXPORT}/**"]) + sh """ + rm -v -rf diff + rm -v -rf meta + mv -v "${ESW}"/* . + """ + archiveArtifacts "${artifactlist}" + } + } + } + } + post { + always { + echo 'Post-build' + } + failure { + echo 'Failed build' + } + unstable { + echo 'Unstable build' + } + success { + echo 'Succeeded build' + } + } +} \ No newline at end of file From 2241c0c982e1b9a5a36fbd2660b8f9de99bc4631 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 17 Dec 2019 18:38:57 +0000 Subject: [PATCH 2/3] GIS-1621 - Allow logic copies from repositories --- copy/logic.groovy | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/copy/logic.groovy b/copy/logic.groovy index 4b3d521..8c82d02 100644 --- a/copy/logic.groovy +++ b/copy/logic.groovy @@ -5,16 +5,18 @@ pipeline { steps { script { meta = load("${WORKSPACE}/autobuild/Common_scripts/autobuilder.groovy").startnonbuild(this) + + importer = load("${autobuilder.commonscripts()}/import/importer.groovy") } } } stage('Clean exports') { steps { script { + env.LOGICDEST = "${WORKSPACE}/logic" cleanfolders = [ - "${WORKSPACE}/logic", + LOGICDEST, "${WORKSPACE}/embedded_logic", - "${WORKSPACE}/diff", // Some old artifacts have this folder ] cleaner = load("${autobuilder.commonscripts()}/clean/clean.groovy") cleaner.clean(cleanfolders) @@ -24,11 +26,7 @@ pipeline { stage('Copying logic artifacts') { steps { script { - env.LOGICDEST = "${WORKSPACE}/logic" - if (LOGIC_ARTIFACT_LOCATION == "Jenkins job artifact") { - importer = load("${autobuilder.commonscripts()}/import/importer.groovy") - importer.artifactimport(meta, LOGIC_ARTIFACT_PROJECT, LOGIC_ARTIFACT_BUILD_SELECTOR, LOGICDEST) - } + importer.artifactimport(meta, LOGIC_ARTIFACT_LOCATION, LOGIC_ARTIFACT_PROJECT, LOGIC_ARTIFACT_BUILD_SELECTOR, LOGIC_RELEASE_REPO, LOGIC _RELEASE_REVISION, LOGICDEST) } } } @@ -37,7 +35,6 @@ pipeline { script { def artifactlist = meta.generateartifacts(["embedded_logic/**"]) sh """ - rm -v -rf diff rm -v -rf meta mv -v "logic"/* . """ From d0f9244af4c83124b338a54c8ac36ece48973290 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 17 Dec 2019 18:43:14 +0000 Subject: [PATCH 3/3] GIS-1621 - Allow logic copies from repositories --- copy/logic.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/copy/logic.groovy b/copy/logic.groovy index 8c82d02..4d5291c 100644 --- a/copy/logic.groovy +++ b/copy/logic.groovy @@ -26,7 +26,7 @@ pipeline { stage('Copying logic artifacts') { steps { script { - importer.artifactimport(meta, LOGIC_ARTIFACT_LOCATION, LOGIC_ARTIFACT_PROJECT, LOGIC_ARTIFACT_BUILD_SELECTOR, LOGIC_RELEASE_REPO, LOGIC _RELEASE_REVISION, LOGICDEST) + importer.artifactimport(meta, LOGIC_ARTIFACT_LOCATION, LOGIC_ARTIFACT_PROJECT, LOGIC_ARTIFACT_BUILD_SELECTOR, LOGIC_RELEASE_REPO, LOGIC_RELEASE_REVISION, LOGICDEST) } } }