Skip to content
Snippets Groups Projects
Commit 27d935cd 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 ce22e2ce
No related branches found
No related tags found
No related merge requests found
This commit is part of merge request !92. Comments created here will be created in the context of that merge request.
......@@ -29,6 +29,8 @@ test_lava_credentials = 'apertis-lava-user'
demopack = "https://images.apertis.org/media/multimedia-demo.tar.gz"
installer_repo_url = "https://repositories.apertis.org/apertis/"
sysroot_url_prefix = image_url_prefix + "/sysroot/"
def architectures = [
......@@ -122,6 +124,8 @@ def architectures = [
]
]
def installers = [ 'mx6sabrelite' ]
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),
......@@ -380,6 +384,69 @@ def buildSysroot(architecture, type, debosarguments = "") {
}
}
def buildInstallers(installers) {
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: installers) {
try {
stage("${target} installer image") {
sh(script: """
mkdir -p ${PIPELINE_VERSION}/installer/${target}")
cd ${PIPELINE_VERSION}/installer/${target}
debos --show-boot \
-t target:${target} \
-t mirror:${installer_repo_url} \
-t suite:${release} \
-t timestamp:${PIPELINE_VERSION} \
-t image:u-boot-installer-${target} \
${WORKSPACE}/uboot-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
......@@ -545,6 +612,14 @@ buildCandidates.each { name, arch ->
}
}
println("buildOnlyList:")
println(buildOnlyList.keySet())
if (buildOnlyList.containsKey("installers")) {
/* Add installer */
first_pass << [("$name $type"):
buildInstallers(installers)
]
}
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