-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathJenkinsfile
45 lines (34 loc) · 1.07 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
#!groovy
stage 'Build'
node {
// step([$class: 'GitHubSetCommitStatusBuilder', statusMessage: [content: 'Building commit...']])
checkout scm
// Build and test
test()
// Archive test results
step([$class: 'JUnitResultArchiver', testResults: '**/build/test-results/TEST-*.xml'])
// Archive PMD results
step([$class: 'PmdPublisher', canComputeNew: false,
defaultEncoding: '', healthy: '',
pattern: '**/pmd/*.xml', unHealthy: ''])
//step([$class: 'PmdPublisher', pattern: '**/pmd/*.xml'])
step([$class: 'GitHubCommitNotifier', resultOnFailure: 'FAILURE',
statusMessage: [content: 'Build finished']])
}
stage 'QA'
node {
// Run mutation testing
sh "./gradlew pitest"
//step([$class: 'PitPublisher'])
}
stage 'Package'
node {
sh "./gradlew jar"
// Archive artifacts
archive includes: '**/build/libs/*.jar'
}
def test() {
// Gradle does not yet support ignoring test failures, bash to the rescue
sh "./gradlew clean check || echo 'There were test failures'"
}
// step([$class: 'GitHubCommitNotifier', resultOnFailure: 'FAILURE'])