Skip to content

Commit

Permalink
Jenkinsfile: build against analogous manifest branch
Browse files Browse the repository at this point in the history
Currently, every pull request and branch build is built against master
branch of the pelux-manifests, which is incorrect since both meta layers
and pelux-manifests follow the Yocto branching strategy, making some of
the branches incompatible between each other.

Build the layer against the corresponding branch of the PELUX manifest
instead, e.g. sumo against sumo and master against master.

Signed-off-by: Oleksandr Kravchuk <oleksandr.kravchuk@pelagicore.com>
  • Loading branch information
sashko committed Dec 3, 2018
1 parent 9bb2d2c commit 65ecd9d
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions scripts/Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,27 @@
#!/usr/bin/groovy

// Copyright (C) Luxoft Sweden AB 2018
// Copyright (C) 2018 Luxoft Sweden AB

void buildBistro(String variant, String imageName) {
String bistroDir = "meta-bistro"
String branchName = "master"

// If this is a PR, CHANGE_TARGET will be set by the Pipeline Plugin,
// otherwise check BRANCH_NAME which is set by Jenkins
if (env.CHANGE_TARGET) {
branchName = "${env.CHANGE_TARGET}"
} else if (env.BRANCH_NAME) {
branchName = "${env.BRANCH_NAME}"
}

node("Yocto") {
dir(bistroDir) {
checkout scm
}

// Initialize pelux-manifests to get the code
sh "rm -rf pelux-manifests/"
sh "git clone https://github.com/Pelagicore/pelux-manifests.git"
sh "git clone https://github.com/Pelagicore/pelux-manifests.git -b ${branchName}"

dir('pelux-manifests') {
def code = load "ci-scripts/yocto.groovy"
Expand All @@ -32,4 +42,3 @@ variantList.each {
}

parallel (variantMap)

0 comments on commit 65ecd9d

Please sign in to comment.