Skip to content
Snippets Groups Projects
Commit 28c962f6 authored by Martyn Welch's avatar Martyn Welch
Browse files

Include SABRE Lite U-Boot installer script in the Jenkinsfile


Signed-off-by: default avatarMartyn Welch <martyn.welch@collabora.com>
parent 236a1f38
No related branches found
No related tags found
1 merge request!92Wip/martyn/u boot installer
......@@ -125,6 +125,8 @@ def architectures = [
]
]
def installerTargets = [ 'mx6qsabrelite-uboot' ]
properties([
parameters([
string(name: 'buildOnly', defaultValue: '', description: 'If set, only the selected images are built. Comma and slash separated, e.g. armhf/minimal, amd64/target', trim: true),
......@@ -390,6 +392,65 @@ def buildSysroot(architecture, type, debosarguments = "") {
}
}
def buildInstallers(installerTargets) {
return {
node("docker-slave") {
checkout scm
docker.withRegistry("https://${docker_registry_name}") {
buildenv = docker.image(docker_image_name)
/* Pull explicitly to ensure we have the latest */
buildenv.pull()
buildenv.inside("--device=/dev/kvm") {
stage("setup installers") {
env.PIPELINE_VERSION = VersionNumber(versionNumberString: '${BUILD_DATE_FORMATTED,"yyyyMMdd"}.${BUILDS_TODAY_Z}')
sh ("env ; mkdir -p ${PIPELINE_VERSION}/installer")
}
def buildStatus = [:]
try {
for(String target: installerTargets) {
try {
stage("${target} installer image") {
sh(script: """
mkdir -p ${PIPELINE_VERSION}/installer/${target}
cd ${PIPELINE_VERSION}/installer/${target}
debos --show-boot \
-t suite:${release} \
${WORKSPACE}/${target}-installer.yaml""")
}
buildStatus["installer-${target}"] = true
} catch (e) {
// If image build failed -- do not fail other types but do not need to start tests for it
buildStatus["installer-${target}"] = false
}
}
// Mark the whole pipeline as failed in case of failure at any stage
if (buildStatus.containsValue(false)) {
currentBuild.result = 'FAILURE'
// mark builds where some artifacts have failed to build
dir ("${env.PIPELINE_VERSION}/meta/") {
writeFile (file: "failed-installers", text: '')
}
}
// Upload artifacts
stage("installers upload") {
uploadDirectory (env.PIPELINE_VERSION, "installers/${release}")
}
} finally {
stage("Cleanup installers") {
deleteDir()
}
}
}
}
}
}
}
/**
* Build OSPack for architecture and start a parallel build of artifacts related
......@@ -554,6 +615,18 @@ buildCandidates.each { name, arch ->
}
}
/* Add installer */
if (buildOnlyList) {
if (buildOnlyList.containsKey('installers')) {
first_pass << [("installers"):
buildInstallers(installerTargets)
]
}
} else {
first_pass << [("installers"):
buildInstallers(installerTargets)
]
}
parallel first_pass
parallel second_pass
......
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