-
Notifications
You must be signed in to change notification settings - Fork 277
Expand file tree
/
Copy pathJenkinsfile
More file actions
43 lines (40 loc) · 1.63 KB
/
Jenkinsfile
File metadata and controls
43 lines (40 loc) · 1.63 KB
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
pipeline {
agent any
stages {
// Mark the code checkout 'stage'....
stage('Checkout') {
steps {
// Get some code from a GitHub repository
git url: 'https://github.com/wdpressplus/Jenkins_Practical_Guide_3rd_Edition.git'
}
}
// Mark the code build 'stage'....
stage('Build, Unittest and Static Analysis') {
steps {
script {
// Global Tool Configuration で Maven 3.5.0 を設定していること。
def mvnHome = tool 'Maven 3.5.0'
if (env.OS == 'Windows_NT') {
bat "${mvnHome}/bin/mvn clean package"
} else {
sh "${mvnHome}/bin/mvn clean package"
}
}
}
}
// Mark the Report of Unittest and Coverage 'stage'....
stage('Report of Unittest and Coverage') {
steps {
junit '**/target/surefire-reports/TEST-*.xml'
step([$class: 'JacocoPublisher'])
}
}
// Mark the Static Analysis 'stage'....
stage('Report of Static Analysis') {
steps {
step([$class: 'CheckStylePublisher', canComputeNew: false, defaultEncoding: '', healthy: '', pattern: '**/target/checkstyle-result.xml', unHealthy: ''])
step([$class: 'FindBugsPublisher', canComputeNew: false, defaultEncoding: '', excludePattern: '', healthy: '', includePattern: '', pattern: '**/target/findbugsXml.xml', unHealthy: ''])
}
}
}
}