-
Notifications
You must be signed in to change notification settings - Fork 194
/
Jenkinsfile
44 lines (43 loc) · 1.08 KB
/
Jenkinsfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
def deployBranch = 'main'
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 agentLabel
}
tools {
maven 'apache-maven-3.9.1'
jdk 'temurin-jdk17-latest'
}
stages {
stage('Build') {
steps {
sh 'mvn --batch-mode -U -V -e clean install site site:stage -Pits -Dmaven.repo.local=$WORKSPACE/.m2/repository'
}
post {
always {
junit '*/target/surefire-reports/TEST-*.xml,*/*/target/surefire-reports/TEST-*.xml,*/*/*/target/surefire-reports/TEST-*.xml'
}
}
}
stage('Deploy Snapshot') {
when {
branch deployBranch
}
steps {
sh 'mvn --batch-mode -V deploy -DskipTests -DaltDeploymentRepository=repo.eclipse.org::https://repo.eclipse.org/content/repositories/tycho-snapshots/'
}
}
}
}