Skip to content

Commit

Permalink
Update Jenkinsfile
Browse files Browse the repository at this point in the history
Use executor based on branch
  • Loading branch information
laeubi committed Apr 2, 2022
1 parent 88e3f3f commit 433104c
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,21 @@
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')
buildDiscarder(logRotator(numToKeepStr:'10'))
disableConcurrentBuilds(abortPrevious: true)
}
agent {
label "centos-8"
label agentLabel
}
tools {
maven 'apache-maven-latest'
Expand All @@ -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/'
Expand Down

0 comments on commit 433104c

Please sign in to comment.