forked from BuildCraft/BuildCraft
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
57 lines (43 loc) · 1.68 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
#!/bin/groovy
// necessary jenkins plugins
// - "Docker Pipeline" (http://wiki.jenkins-ci.org/display/JENKINS/Docker+Pipeline+Plugin)
///////////////////////////////////////////////////////////////////////////////
catchError() {
properties([
buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '14', daysToKeepStr: '14', numToKeepStr: '180')),
disableConcurrentBuilds()
])
milestone label: 'Start'
node() {
stage("Checkout") {
checkout scm
sh """set -x
git submodule foreach "git reset --hard || true" || true
git reset --hard || true
git submodule update --init || true
"""
}
milestone label: 'Checkout complete'
withDockerContainer('openjdk:8-jdk') {
stage("Build") {
sh """set -x
./gradlew build -x test
"""
archiveArtifacts artifacts: 'build/libs/*.jar', fingerprint: true, onlyIfSuccessful: true
}
milestone label: 'Build complete'
stage("Test") {
try {
sh """set -x
./gradlew clean test
"""
step([$class: 'JUnitResultArchiver', testResults: '**/build/test-results/test/TEST-*.xml'])
} catch (e) {
currentBuild.result = "UNSTABLE"
echo "Exception caught while running test: ${e}"
}
}
milestone label: 'Test complete'
}
}
} // catchError()