Create a script to copy logic to a build job - so that it will be stamped during release

This commit is contained in:
Dan Hawkins 2019-03-24 12:21:15 +00:00
commit 9e0f24f0d2

56
copy/logic.groovy Normal file
View file

@ -0,0 +1,56 @@
pipeline {
agent { label "${AGENT_LABEL}" }
stages {
stage('Initial setup') {
steps {
script {
meta = load("${WORKSPACE}/autobuild/Common_scripts/autobuilder.groovy").startnonbuild(this)
}
}
}
stage('Clean exports') {
steps {
script {
cleanfolders = [
"${WORKSPACE}/logic",
]
cleaner = load("${autobuilder.commonscripts()}/clean/clean.groovy")
cleaner.clean(cleanfolders)
}
}
}
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)
}
}
}
}
stage('Archiving artifacts') {
steps {
script {
def artifactlist = meta.generateartifacts(["logic/**"])
archiveArtifacts "${artifactlist}"
}
}
}
}
post {
always {
echo 'Post-build'
}
failure {
echo 'Failed build'
}
unstable {
echo 'Unstable build'
}
success {
echo 'Succeeded build'
}
}
}