Skip to content

Commit

Permalink
Set platform from pr label (SUSE#1117)
Browse files Browse the repository at this point in the history
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 a5df22e)
  • Loading branch information
pablochacin committed Jul 8, 2020
1 parent d33a47a commit e0a4c64
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion ci/jenkins/pipelines/prs/skuba-test.Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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'
Expand Down

0 comments on commit e0a4c64

Please sign in to comment.