From d531d85aa26370066ca491b5dad2b1f0b6bedac0 Mon Sep 17 00:00:00 2001 From: Arjen Hiemstra Date: Mon, 29 May 2017 16:59:38 +0200 Subject: [PATCH] Select build environment on CI based on branch name --- Jenkinsfile | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 2c101b2183..7b45eafdf5 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -14,9 +14,14 @@ parallel_nodes(['linux && cura', 'windows && cura']) { dir('build') { // Perform the "build". Since Uranium is Python code, this basically only ensures CMake is setup. stage('Build') { + def branch = env.BRANCH_NAME + if(!(branch =~ /^2.\d+$/)) { + branch = "master" + } + // Ensure CMake is setup. Note that since this is Python code we do not really "build" it. - def uranium_dir = get_workspace_dir("Ultimaker/Uranium/master") - cmake("..", "-DCMAKE_PREFIX_PATH=${env.CURA_ENVIRONMENT_PATH} -DCMAKE_BUILD_TYPE=Release -DURANIUM_DIR=${uranium_dir}") + def uranium_dir = get_workspace_dir("Ultimaker/Uranium/${branch}") + cmake("..", "-DCMAKE_PREFIX_PATH=${env.CURA_ENVIRONMENT_PATH}/${branch} -DCMAKE_BUILD_TYPE=Release -DURANIUM_DIR=${uranium_dir}") } // Try and run the unit tests. If this stage fails, we consider the build to be "unstable".