Skip to content
Snippets Groups Projects
Commit 219f2666 authored by Emanuele Aina's avatar Emanuele Aina
Browse files

Jenkinsfile: Add metadata to detect partial builds


Keep track of skipped artifacts, failed builds and if the build has been
killed half way so we can find out if a build is suitable for
releasing/longer term preservation (for instance, for being saved as a
weekly entry).

Signed-off-by: Emanuele Aina's avatarEmanuele Aina <emanuele.aina@collabora.com>
parent c97ef6bc
No related branches found
No related tags found
1 merge request!66Add metadata to detect partial builds
This commit is part of merge request !91. Comments created here will be created in the context of that merge request.
......@@ -474,7 +474,11 @@ def buildImages(architecture, type, boards, debosarguments = "", image = true, s
// Mark the whole pipeline as failed in case of failure at any stage
if (buildStatus.containsValue(false)) {
currentBuild.result = 'FAILURE'
currentBuild.result = 'FAILURE'
// mark builds where some artifacts have failed to build
dir ("${env.PIPELINE_VERSION}/meta/") {
writeFile (file: "failed-${architecture}-${type}", text: '')
}
}
// Upload artifacts
......@@ -551,3 +555,35 @@ buildCandidates.each { name, arch ->
parallel first_pass
parallel second_pass
node() {
stage("upload meta") {
skipped = architectures - buildCandidates
complete = !skipped && currentBuild.resultIsBetterOrEqualTo('SUCCESS')
skippednames = []
for (architecture in skipped) {
for (type in architecture.value.types) {
skippednames << "skipped-${architecture.key}-${type.key}"
}
}
dir ("${env.PIPELINE_VERSION}/meta/") {
writeFile (file: "build-version", text: env.PIPELINE_VERSION)
writeFile (file: "build-url", text: env.BUILD_URL)
// report which entries have been skipped
for (String skippedname : skippednames) {
writeFile (file: skippedname, text: '')
}
// mark builds that have not been killed half way
writeFile (file: "finished", text: '')
// mark successful builds with no skipped artifacts, they're the best candidates for longer term storage
if (complete) {
writeFile (file: "complete", text: '')
}
}
uploadDirectory (env.PIPELINE_VERSION, "daily/${release}")
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment