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 { importer = load("${autobuilder.commonscripts()}/import/importer.groovy") BUILD_ARTIFACTS = 'build' def importoptions = importer.getNewImportOptions() importoptions.jenkinsjob(BUILD_JOB, BUILD_JOB_SELECTOR) importoptions.setincrementversionnumber(false) importoptions.setfilter('meta/**') importoptions.setappendtoparentmeta(false) buildmeta = importer.artifactimport(meta, importoptions, 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('', BUILD_ARTIFACTS, 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() artifactarchiver = load("${autobuilder.commonscripts()}/artifacts/archiver.groovy") artifactarchiver.archive("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' } } }