forked from Pelagicore/pelux-manifests
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
executable file
·46 lines (36 loc) · 1.33 KB
/
Jenkinsfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/usr/bin/groovy
// Copyright (C) Luxoft Sweden AB 2018
// Run the different variants in parallel, on different slaves (if possible)
// We could do a single "checkout scm" and load the groovy script, but to do
// that one has to allocate a node first, which would stay busy until the end of
// the parallel pipeline
void buildOnYoctoNode(String variant, String image) {
node("Yocto") {
checkout scm
def manifests = load "ci-scripts/yocto.groovy"
manifests.buildManifest(variant, image)
}
}
def variantMap = [:]
def variantList = []
// If VARIANT_LIST is defined in the Jenkins Environment
// then use that, otherwise use the default
// Note: This function will throw a NullPointerException if the
// variable is not set.
try {
variantList = env.VARIANT_LIST.split()
echo "Using the specified variant list for build"
println "[\"${variantList.join('", "')}\"]"
} catch(e) {
println("Using the default variant list for build. \nCaught error: " + e)
variantList = ['intel-qtauto:core-image-pelux-qtauto-neptune-dev',
'rpi-qtauto:core-image-pelux-qtauto-neptune-dev']
println "[\"${variantList.join('", "')}\"]"
}
variantList.each {
def list = it.split(":")
variantMap["${list[0]}"] = {
buildOnYoctoNode(list[0], list[1])
}
}
parallel (variantMap)