Skip to content

Commit ea75ee2

Browse files
authored
Create Jenkinsfile-mac
1 parent 6f952d9 commit ea75ee2

File tree

1 file changed

+58
-0
lines changed

1 file changed

+58
-0
lines changed

jenkins/Jenkinsfile-mac

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
pipeline {
2+
agent any
3+
stages {
4+
stage ('stage1-clone-git-repo') {
5+
steps {
6+
git 'https://github.com/lerndevops/samplejavaapp.git'
7+
}
8+
}
9+
stage ('stage2-compile') {
10+
steps {
11+
sh '/opt/homebrew/Cellar/maven/3.9.8/libexec/bin/mvn compile'
12+
}
13+
post {
14+
always {
15+
sh 'echo send email'
16+
}
17+
}
18+
}
19+
stage ('stage3-codereview') {
20+
steps {
21+
sh '/opt/homebrew/Cellar/maven/3.9.8/libexec/bin/mvn -P metrics pmd:pmd'
22+
}
23+
post {
24+
success {
25+
recordIssues sourceCodeRetention: 'LAST_BUILD', tools: [pmdParser(pattern: '**/pmd.xml')]
26+
}
27+
always {
28+
sh 'echo send email'
29+
}
30+
}
31+
}
32+
stage ('stage4-unitest') {
33+
steps {
34+
sh '/opt/homebrew/Cellar/maven/3.9.8/libexec/bin/mvn test'
35+
}
36+
post {
37+
success {
38+
junit stdioRetention: '', testResults: 'target/surefire-reports/*.xml'
39+
}
40+
}
41+
}
42+
stage ('stage5-code-coverage') {
43+
steps {
44+
sh '/opt/homebrew/Cellar/maven/3.9.8/libexec/bin/mvn verify'
45+
}
46+
post {
47+
success {
48+
jacoco buildOverBuild: true, runAlways: true
49+
}
50+
}
51+
}
52+
stage ('stage6-packaeg') {
53+
steps {
54+
sh '/opt/homebrew/Cellar/maven/3.9.8/libexec/bin/mvn verify'
55+
}
56+
}
57+
}
58+
}

0 commit comments

Comments
 (0)