-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
63 lines (61 loc) · 1.98 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
pipeline {
agent {
docker {
image 'maven:3.5.2-jdk-9-slim'
args '-v /root/.m2:/root/.m2'
}
}
stages {
stage('Build') {
steps {
sh 'mvn -B clean compile'
}
post {
always {
checkstyle pattern: '**/checkstyle-result.xml'
pmd canComputeNew: false, canRunOnFailed: true, defaultEncoding: '', healthy: '', pattern: '**/target/pmd.xml', unHealthy: ''
warnings canComputeNew: false, canResolveRelativePaths: false, categoriesPattern: '', consoleParsers: [[parserName: 'Java Compiler (javac)']], defaultEncoding: '', excludePattern: '', healthy: '', includePattern: '', messagesPattern: '', unHealthy: ''
// cpd
}
}
}
stage('Test') {
steps {
sh 'mvn -B test'
}
post {
always {
stash name: "testresults", includes: "**/*-reports/**/*.xml,**/target/**/classes/**/*.class,**/target/**.exec"
}
}
}
stage('Integration-Test') {
steps {
sh 'mvn -B verify'
}
post {
always {
stash name: "testresults", includes: "**/*-reports/**/*.xml,**/target/**/classes/**/*.class,**/target/**.exec"
}
}
}
stage('Deploy') {
steps {
//timeout(time: 5, unit: 'DAYS') {
// input message: 'Approve deployment?'
//}
echo 'Deploy'
}
}
}
post {
always {
unstash 'testresults'
junit '**/*-reports/**/*.xml'
jacoco classPattern: '**/target/**/classes', execPattern: '**/target/jacoco-aggregate.exec'
}
success {
archive "target/*-exec.jar"
}
}
}