From 433104c5169a5552c12193df3b3859bba88ddb8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20L=C3=A4ubrich?= Date: Sat, 2 Apr 2022 12:53:30 +0200 Subject: [PATCH] Update Jenkinsfile Use executor based on branch --- Jenkinsfile | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 5321844c27..9d113c841e 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,3 +1,13 @@ +def deployBranch = 'master' +def agentLabel +if(env.BRANCH_NAME == deployBranch) { + //branches that are deployable must run on eclipse infra + agentLabel = "centos-latest" +} else { + //others (prs for example) can run on any infra + agentLabel = "centos-latest || linux" +} + pipeline { options { timeout(time: 180, unit: 'MINUTES') @@ -5,7 +15,7 @@ pipeline { disableConcurrentBuilds(abortPrevious: true) } agent { - label "centos-8" + label agentLabel } tools { maven 'apache-maven-latest' @@ -25,7 +35,7 @@ pipeline { } stage('Deploy Snapshot') { when { - branch 'master' + branch deployBranch } steps { sh 'mvn --batch-mode -V deploy -DskipTests -DaltDeploymentRepository=repo.eclipse.org::default::https://repo.eclipse.org/content/repositories/tycho-snapshots/'