Skip to content

Commit 977825b

Browse files
committed
Dockerfile & Jenkinsfile
1 parent 4ccf997 commit 977825b

4 files changed

Lines changed: 106 additions & 1 deletion

File tree

Dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
FROM tomcat
2+
ADD addressbook.war /usr/local/tomcat/webapps
3+
EXPOSE 8080
4+
CMD /usr/local/tomcat/bin/catalina.sh run

Jenkinsfile

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
pipeline {
2+
agent any
3+
stages {
4+
stage('compile') {
5+
steps {
6+
echo 'compiling..'
7+
git url: 'https://github.com/lerndevops/DevOpsClassCodes'
8+
sh label: '', script: 'mvn compile'
9+
}
10+
}
11+
stage('codereview-pmd') {
12+
steps {
13+
echo 'codereview..'
14+
sh label: '', script: 'mvn -P metrics pmd:pmd'
15+
}
16+
post {
17+
success {
18+
pmd canComputeNew: false, defaultEncoding: '', healthy: '', pattern: '**/pmd.xml', unHealthy: ''
19+
}
20+
}
21+
}
22+
stage('unit-test') {
23+
steps {
24+
echo 'codereview..'
25+
sh label: '', script: 'mvn test'
26+
}
27+
post {
28+
success {
29+
junit 'target/surefire-reports/*.xml'
30+
}
31+
}
32+
}
33+
stage('metric-check') {
34+
steps {
35+
echo 'unit test..'
36+
sh label: '', script: 'mvn cobertura:cobertura -Dcobertura.report.format=xml'
37+
}
38+
post {
39+
success {
40+
cobertura autoUpdateHealth: false, autoUpdateStability: false, coberturaReportFile: 'target/site/cobertura/coverage.xml', conditionalCoverageTargets: '70, 0, 0', failUnhealthy: false, failUnstable: false, lineCoverageTargets: '80, 0, 0', maxNumberOfBuilds: 0, methodCoverageTargets: '80, 0, 0', onlyStable: false, sourceEncoding: 'ASCII', zoomCoverageChart: false
41+
}
42+
}
43+
}
44+
stage('package') {
45+
steps {
46+
echo 'metric-check..'
47+
sh label: '', script: 'mvn package'
48+
}
49+
}
50+
}
51+
}

Jenkinsfile-win

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
pipeline {
2+
agent any
3+
stages {
4+
stage('compile') {
5+
steps {
6+
echo 'compiling..'
7+
git url: 'https://github.com/lerndevops/DevOpsClassCodes'
8+
bat label: '', script: 'mvn compile'
9+
}
10+
}
11+
stage('codereview-pmd') {
12+
steps {
13+
echo 'codereview..'
14+
bat label: '', script: 'mvn -P metrics pmd:pmd'
15+
}
16+
post {
17+
success {
18+
pmd canComputeNew: false, defaultEncoding: '', healthy: '', pattern: '**/pmd.xml', unHealthy: ''
19+
}
20+
}
21+
}
22+
stage('unit-test') {
23+
steps {
24+
echo 'codereview..'
25+
bat label: '', script: 'mvn test'
26+
}
27+
post {
28+
success {
29+
junit 'target/surefire-reports/*.xml'
30+
}
31+
}
32+
}
33+
stage('metric-check') {
34+
steps {
35+
echo 'unit test..'
36+
bat label: '', script: 'mvn cobertura:cobertura -Dcobertura.report.format=xml'
37+
}
38+
post {
39+
success {
40+
cobertura autoUpdateHealth: false, autoUpdateStability: false, coberturaReportFile: 'target/site/cobertura/coverage.xml', conditionalCoverageTargets: '70, 0, 0', failUnhealthy: false, failUnstable: false, lineCoverageTargets: '80, 0, 0', maxNumberOfBuilds: 0, methodCoverageTargets: '80, 0, 0', onlyStable: false, sourceEncoding: 'ASCII', zoomCoverageChart: false
41+
}
42+
}
43+
}
44+
stage('package') {
45+
steps {
46+
echo 'metric-check..'
47+
bat label: '', script: 'mvn package'
48+
}
49+
}
50+
}
51+
}

laskd

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)