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

Allow images to declare dependencies


A new parameter, 'requires', allows declaring a dependency on
a different image build.

Instead of a single artifact list, define two lists.
First build artifacts not requiring any other artifacts,
then build artifacts depending on other artifacts.

This code doesn’t support transitive dependencies.

Signed-off-by: default avatarAndrej Shadura <andrew.shadura@collabora.co.uk>
parent 79c8d311
No related branches found
No related tags found
1 merge request!42Revamp the image build orchestration
......@@ -57,6 +57,9 @@ def architectures = [
image: true,
sysroot: false,
ostree: false,
requires: [
armhf: 'development',
]
]
]
],
......@@ -101,6 +104,7 @@ def architectures = [
]
]
]
// SSH complains loudly if the current user is not in the user database, so fake that
def withSshAgent(credentials, command) {
sshagent(credentials: [ credentials, ] ) {
......@@ -464,18 +468,29 @@ def buildImages(architecture, type, boards, debosarguments = "", image = true, s
}
}
def artifacts = [:]
def first_pass = [:]
def second_pass = [:]
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)
]
if (!params.requires) {
/* first, build all jobs which don’t have any dependencies, in parallel */
first_pass << [("$name $type"):
buildImages(name, type, merged.boards, merged.args, merged.image, merged.sysroot, merged.ostree, production)
]
} else {
/* second, build any jobs which depend on jobs from the first pass, also in parallel */
second_pass << [("$name $type"):
buildImages(name, type, merged.boards, merged.args, merged.image, merged.sysroot, merged.ostree, production)
]
}
}
}
parallel artifacts
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