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

Allow building only selected images

parent 910db90c
No related branches found
No related tags found
No related merge requests found
......@@ -112,6 +112,33 @@ def architectures = [
]
]
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),
])
])
def buildCandidates = [:]
def buildOnlyList = params?.buildOnly.tokenize(/, ?/).collect { it.tokenize('/') }
buildOnlyList = buildOnlyList
.groupBy{ it[0] }
.collectEntries{ arch, values -> [arch, values.findResults { it[1] } ] }
buildCandidates = architectures
// filter out architectures which won't be built
.subMap(buildOnlyList.keySet())
.collectEntries{ arch, architecture ->
// filter out artifact types which won't be built
types = architecture.types
if (buildOnlyList[arch])
types = architecture.types.subMap(buildOnlyList[arch])
[arch, architecture + [
types: types
]]
}
// SSH complains loudly if the current user is not in the user database, so fake that
def withSshAgent(credentials, command) {
sshagent(credentials: [ credentials, ] ) {
......@@ -478,7 +505,7 @@ def buildImages(architecture, type, boards, debosarguments = "", image = true, s
def first_pass = [:]
def second_pass = [:]
architectures.each { name, arch ->
buildCandidates.each { name, arch ->
arch.types.each { type, params ->
/* merge the per-arch default with per-type params */
def merged = [:] << arch << params
......
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