From 09aa494e62e2368863286694007fb988a3dd7d9d Mon Sep 17 00:00:00 2001 From: pablochacin Date: Tue, 26 May 2020 19:02:17 +0200 Subject: [PATCH] Set platform from pr label (#1117) Set platform from PR labels * If PR specifies a ci-platform label, override the default test platform. * PR tests can run in any supported platoform. Add the configuration required by libvirt to the environment. (cherry picked from commit e7bf1b2d2ab6d6a792c8763080808acdc8f61cc3) --- ci/jenkins/pipelines/prs/skuba-test.Jenkinsfile | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/ci/jenkins/pipelines/prs/skuba-test.Jenkinsfile b/ci/jenkins/pipelines/prs/skuba-test.Jenkinsfile index 41561a3ea0..e8b576149c 100644 --- a/ci/jenkins/pipelines/prs/skuba-test.Jenkinsfile +++ b/ci/jenkins/pipelines/prs/skuba-test.Jenkinsfile @@ -4,12 +4,16 @@ * - Basic skuba deployment, bootstrapping, and adding nodes to a cluster */ + +// Platform for pr tests. +def platform = 'vmware' + // Branch specific repo def branch_repo = "" // Set the agent platform label. Cannot be set using the environment variables // because agent labels are evaluated before environment is set -labels='' +def labels='' node('caasp-team-private-integration') { stage('set-labels') { try { @@ -25,6 +29,14 @@ node('caasp-team-private-integration') { def label = it.name.split(":")[1] labels = labels + " && " + label } + // check if the PR request an specific test platform + def pr_platform_label = pr.labels.find { + it.name.startsWith("ci-platform") + } + if (pr_platform_label != null) { + platform = pr_platform_label.name.split(":")[1] + } + } catch (Exception e) { echo "Error retrieving labels for PR ${e.getMessage()}" currentBuild.result = 'ABORTED'