forked from eclipse-tycho/tycho
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
52 lines (51 loc) · 1.22 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
45
46
47
48
49
50
51
52
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 agentLabel
}
tools {
maven 'apache-maven-3.8.6'
jdk 'openjdk-jdk17-latest'
}
stages {
stage('Build') {
steps {
sh 'mvn --batch-mode -U -V -e clean install -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/'
}
}
stage('Deploy sitedocs') {
when {
branch 'master'
}
steps {
sh 'mvn --batch-mode -V clean install site site:stage -DskipTests=true'
}
}
}
}