88 lines
2.9 KiB
Groovy
88 lines
2.9 KiB
Groovy
pipeline {
|
|
agent { label "${AGENT_LABEL}" }
|
|
stages {
|
|
stage('Initial setup') {
|
|
steps {
|
|
script {
|
|
autobuilderscript = load("${WORKSPACE}/autobuild/Common_scripts/autobuilder.groovy")
|
|
meta = autobuilderscript.startnonbuild(this)
|
|
}
|
|
}
|
|
}
|
|
stage('Clean exports') {
|
|
steps {
|
|
script {
|
|
cleanfolders = [
|
|
"${WORKSPACE}/build_artifacts",
|
|
]
|
|
cleaner = load("${autobuilder.commonscripts()}/clean/clean.groovy")
|
|
cleaner.clean(cleanfolders)
|
|
}
|
|
}
|
|
}
|
|
stage('Get build artifact meta') {
|
|
steps {
|
|
script {
|
|
BUILD_ARTIFACTS = "${WORKSPACE}/build_artifacts"
|
|
copyArtifacts(
|
|
filter: 'meta/**',
|
|
projectName: BUILD_JOB,
|
|
selector: [
|
|
$class: 'ParameterizedBuildSelector',
|
|
parameterName: BUILD_JOB_SELECTOR
|
|
],
|
|
target: BUILD_ARTIFACTS
|
|
)
|
|
def mfs = autobuilderscript.getmetafolderscript()
|
|
buildmeta = mfs.metafromfolder(BUILD_ARTIFACTS)
|
|
}
|
|
}
|
|
}
|
|
stage('Release components') {
|
|
steps {
|
|
script {
|
|
def releaser = load("${autobuilder.commonscripts()}/release/do.groovy")
|
|
// Place the top level build stamp on all
|
|
OTHER_RELEASE_TAGS = "${buildmeta.globalreleasetag()},${OTHER_RELEASE_TAGS}"
|
|
(summarystring, markunstable, unstablereason) = releaser.releasehierarchy(buildmeta, MAX_META_DEPTH, OTHER_RELEASE_TAGS, DRY_RUN_PUSH)
|
|
if (markunstable) {
|
|
env.unstablereason = unstablereason
|
|
currentBuild.result = 'UNSTABLE'
|
|
}
|
|
}
|
|
}
|
|
}
|
|
stage('Archiving artifacts') {
|
|
steps {
|
|
script {
|
|
def artifactlist = meta.generateartifacts()
|
|
archiveArtifacts "summary/**,${artifactlist}"
|
|
}
|
|
}
|
|
}
|
|
stage('Summarise') {
|
|
steps {
|
|
script {
|
|
echo "Summary:\n${summarystring}\n"
|
|
if (env.unstablereason) {
|
|
echo "Instability reason: ${env.unstablereason}"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
post {
|
|
always {
|
|
echo 'Post-build'
|
|
}
|
|
failure {
|
|
echo 'Failed build'
|
|
}
|
|
unstable {
|
|
echo 'Unstable build'
|
|
}
|
|
success {
|
|
echo 'Succeeded build'
|
|
}
|
|
}
|
|
}
|