Skip to content

Commit

Permalink
Jenkinsfile: parameterize variants & images to be built
Browse files Browse the repository at this point in the history
The variants and images to be built were hardcoded in
JenkinsFile. So if there was a need to add or remove
variants and images, the code needs to be changed. With
this change, a list of variant and images are defined
in Jenkins Environment, which are read dynamically in
JenkinsFile. So adding/removing variants and images do
not require code change.

Signed-off-by: Tariq Ansari <tansari@luxoft.com>
(cherry picked from commit a0d6cdf)
  • Loading branch information
TSAnsari authored and Therese Nordqvist committed Nov 13, 2018
1 parent 614acc9 commit 3b807bb
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions scripts/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,15 @@ void buildBistro(String variant, String imageName) {
}
}

parallel (
'intel': { buildBistro("intel", "core-image-pelux-minimal") },
'intel-qtauto': { buildBistro("intel-qtauto", "core-image-pelux-qtauto-neptune") },
'rpi': { buildBistro("rpi", "core-image-pelux-minimal") },
'rpi-qtauto': { buildBistro("rpi-qtauto", "core-image-pelux-qtauto-neptune") }
)
def variantMap = [:]
def variantList = env.VARIANT_LIST.split()

variantList.each {
def list = it.split(":")
variantMap["${list[0]}"] = {
buildBistro(list[0], list[1])
}
}

parallel (variantMap)

0 comments on commit 3b807bb

Please sign in to comment.