forked from eclipse/xtext-xtend
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
64 lines (55 loc) · 2.24 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
53
54
55
56
57
58
59
60
61
62
63
64
// Tell Jenkins how to build projects from this repository
node {
try {
properties([
[$class: 'BuildDiscarderProperty', strategy: [$class: 'LogRotator', numToKeepStr: '15']]
])
stage 'Checkout'
checkout scm
dir('build') {
deleteDir()
}
stage 'Gradle Build'
try {
sh "./gradlew clean cleanGenerateXtext build createLocalMavenRepo -PuseJenkinsSnapshots=true -PcompileXtend=true --refresh-dependencies --continue"
archive 'build/maven-repository/**/*.*'
} finally {
step([$class: 'JUnitResultArchiver', testResults: '**/build/test-results/test/*.xml'])
}
def workspace = pwd()
def mvnHome = tool 'M3'
env.M2_HOME = "${mvnHome}"
dir('.m2/repository/org/eclipse/xtext') { deleteDir() }
dir('.m2/repository/org/eclipse/xtend') { deleteDir() }
try {
stage 'Maven Plugin Build'
sh "${mvnHome}/bin/mvn -f maven-pom.xml --batch-mode --update-snapshots -fae -PuseJenkinsSnapshots -Dmaven.test.failure.ignore=true -Dmaven.repo.local=${workspace}/.m2/repository clean deploy"
stage 'Maven Tycho Build'
wrap([$class:'Xvnc', useXauthority: true]) {
sh "${mvnHome}/bin/mvn -f tycho-pom.xml --batch-mode -fae -Dmaven.test.failure.ignore=true -Dmaven.repo.local=${workspace}/.m2/repository clean install"
}
archive 'build/**'
} finally {
step([$class: 'JUnitResultArchiver', testResults: '**/target/surefire-reports/*.xml'])
}
stage 'Gradle Longrunning Tests'
try {
sh "./gradlew longrunningTest -PuseJenkinsSnapshots=true --continue"
} finally {
step([$class: 'JUnitResultArchiver', testResults: '**/build/test-results/longrunningTest/*.xml'])
}
if ('UNSTABLE' == currentBuild.result) {
slackSend color: 'warning', message: "Build Unstable - ${env.JOB_NAME} ${env.BUILD_NUMBER} (<${env.BUILD_URL}|Open>)"
} else {
slackSend color: 'good', message: "Build Succeeded - ${env.JOB_NAME} ${env.BUILD_NUMBER} (<${env.BUILD_URL}|Open>)"
}
} catch (e) {
// TODO catch interrupt error instead
if ('ABORTED' == currentBuild.result) {
slackSend message: "Build Aborted - ${env.JOB_NAME} ${env.BUILD_NUMBER} (<${env.BUILD_URL}|Open>)"
} else {
slackSend color: 'danger', message: "Build Failed - ${env.JOB_NAME} ${env.BUILD_NUMBER} (<${env.BUILD_URL}|Open>)"
}
throw e
}
}