Skip to content

Commit fc61bf7

Browse files
authored
Create Jenkinsfile
1 parent 6f3a782 commit fc61bf7

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

jenkins/Jenkinsfile

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
pipeline {
2+
agent any
3+
stages {
4+
stage('compile') {
5+
steps {
6+
echo 'compiling..'
7+
git url: 'https://github.com/lerndevops/samplejavaapp'
8+
sh script: '/opt/maven/bin/mvn compile'
9+
}
10+
}
11+
stage('codereview-pmd') {
12+
steps {
13+
echo 'codereview..'
14+
sh script: '/opt/maven/bin/mvn -P metrics pmd:pmd'
15+
}
16+
post {
17+
success {
18+
recordIssues enabledForFailure: true, tool: pmdParser(pattern: '**/target/pmd.xml')
19+
}
20+
}
21+
}
22+
stage('unit-test') {
23+
steps {
24+
echo 'unittest..'
25+
sh script: '/opt/maven/bin/mvn test'
26+
}
27+
post {
28+
success {
29+
junit 'target/surefire-reports/*.xml'
30+
}
31+
}
32+
}
33+
stage('package') {
34+
steps {
35+
echo 'package......'
36+
sh script: '/opt/maven/bin/mvn package'
37+
}
38+
}
39+
}
40+
}

0 commit comments

Comments
 (0)