Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create Jenkinsfile #40

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
pipeline {
agent any
stages {
stage('compile') {
steps {
echo 'compiling..'
git url: 'https://github.com/lerndevops/DevOpsClassCodes'
bat label: '', script: 'mvn compile'
}
}
stage('codereview-pmd') {
steps {
echo 'codereview..'
bat label: '', script: 'mvn -P metrics pmd:pmd'
}
post {
success {
pmd canComputeNew: false, defaultEncoding: '', healthy: '', pattern: '**/pmd.xml', unHealthy: ''
}
}
}
stage('unit-test') {
steps {
echo 'codereview..'
bat label: '', script: 'mvn test'
}
post {
success {
junit 'target/surefire-reports/*.xml'
}
}
}
stage('metric-check') {
steps {
echo 'unit test..'
bat label: '', script: 'mvn cobertura:cobertura -Dcobertura.report.format=xml'
}
post {
success {
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
}
}
}
stage('package') {
steps {
echo 'metric-check..'
bat label: '', script: 'mvn package'
}
}
}
}