Skip to content
Snippets Groups Projects
Verified Commit 79c8d311 authored by Andrej Shadura's avatar Andrej Shadura
Browse files

Use a more verbose but more readable image definition format


Instead of manually assembling the artifact list by calling
buildImages with cryptic indexed arguments, take a more declarative
approach of putting everything into a single map and creating
the artifact list out of it programmatically.

Signed-off-by: default avatarAndrej Shadura <andrew.shadura@collabora.co.uk>
parent a7e7e101
No related branches found
No related tags found
No related merge requests found
......@@ -29,6 +29,78 @@ demopack = "https://images.apertis.org/media/multimedia-demo.tar.gz"
sysroot_url_prefix = "https://images.apertis.org/" + (production ? "" : "test/${env.JOB_NAME}/") + "sysroot/"
def architectures = [
amd64: [
boards: ['uefi'],
types: [
minimal: [
args: '',
image: true,
sysroot: false,
ostree: true,
],
target: [
args: '',
image: true,
sysroot: false,
ostree: true,
],
development: [
args: '--scratchsize 10G',
image: false,
sysroot: true,
ostree: false,
],
sdk: [
args: '--scratchsize 10G',
boards: [ 'sdk' ],
image: true,
sysroot: false,
ostree: false,
]
]
],
arm64: [
boards: ['uboot'],
types: [
minimal: [
args: '',
image: true,
sysroot: false,
ostree: true,
],
target: [
args: '',
image: true,
sysroot: false,
ostree: true,
],
development: [
args: '--scratchsize 10G',
image: false,
sysroot: true,
ostree: false,
]
]
],
armhf: [
boards: ['uboot', 'mx6qsabrelite'],
types: [
minimal: [
args: '',
image: true,
sysroot: false,
ostree: true
],
development: [
args: '--scratchsize 10G',
image: false,
sysroot: true,
ostree: false
]
]
]
]
// SSH complains loudly if the current user is not in the user database, so fake that
def withSshAgent(credentials, command) {
sshagent(credentials: [ credentials, ] ) {
......@@ -394,54 +466,16 @@ def buildImages(architecture, type, boards, debosarguments = "", image = true, s
def artifacts = [:]
////////// Amd64 //////////
artifacts["Sdk"] = buildImages("amd64", "sdk", [ "sdk" ],
"--scratchsize 10G",
true, false, false, production)
// Types for all boards, common debos arguments, sysroots and ostree
def types = [
[ "minimal", "", true, false, true],
[ "target", "", true, false, true],
[ "development", "--scratchsize 10G", false, true, false]
]
artifacts += types.collectEntries { [ "Amd64 ${it[0]}": buildImages("amd64",
it[0],
["uefi"],
it[1],
it[2],
it[3],
it[4],
production ) ] }
////////// Arm64 //////////
// Build the same types as for Amd64
artifacts += types.collectEntries { [ "Arm64 ${it[0]}": buildImages("arm64",
it[0],
["uboot"],
it[1],
it[2],
it[3],
it[4],
production ) ] }
////////// Armhf //////////
// Types for all boards, common debos arguments, sysroots and ostree
// TODO: change the types list for Armhf if we have a graphics support
types = [
[ "minimal", "", true, false, true],
[ "development", "--scratchsize 10G", false, true, false]
]
architectures.each { name, arch ->
arch.types.each { type, params ->
/* merge the per-arch default with per-type params */
def merged = [:] << arch << params
artifacts << [("$name $type"):
buildImages(name, type, merged.boards, merged.args, merged.image, merged.sysroot, merged.ostree, production)
]
}
}
artifacts += types.collectEntries { [ "Armhf ${it[0]}": buildImages("armhf",
it[0],
["uboot", "mx6qsabrelite"],
it[1],
it[2],
it[3],
it[4],
production ) ] }
parallel artifacts
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