forked from eclipse/xtext-eclipse
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
38 lines (35 loc) · 1.32 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
node {
properties([
[$class: 'BuildDiscarderProperty', strategy: [$class: 'LogRotator', numToKeepStr: '15']],
parameters([
choice(choices: 'luna\noxygen\nphoton', description: 'Which Target Platform should be used?', name: 'target_platform')
])
])
stage('Checkout') {
checkout scm
if ("oxygen" == params.target_platform) {
currentBuild.displayName = "#${BUILD_NUMBER}(o)"
} else if ("photon" == params.target_platform) {
currentBuild.displayName = "#${BUILD_NUMBER}(p)"
} else {
currentBuild.displayName = "#${BUILD_NUMBER}(l)"
}
dir('build') { deleteDir() }
dir('.m2/repository/org/eclipse/xtext') { deleteDir() }
dir('.m2/repository/org/eclipse/xtend') { deleteDir() }
}
stage('Maven Build') {
def mvnHome = tool 'M3'
def targetProfile = "-Pluna"
if ("oxygen" == params.target_platform) {
targetProfile = "-Poxygen"
} else if ("photon" == params.target_platform) {
targetProfile = "-Pphoton"
}
wrap([$class:'Xvnc', useXauthority: true]) {
sh "${mvnHome}/bin/mvn --batch-mode -fae -Dmaven.test.failure.ignore=true -Dmaven.repo.local=.m2/repository -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn ${targetProfile} clean install"
}
step([$class: 'JUnitResultArchiver', testResults: '**/target/surefire-reports/*.xml'])
}
archive 'build/**'
}