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 #12

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
57 changes: 57 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
pipeline{
tools{
jdk 'myjava'
maven 'mymaven'
}

agent none
stages{
stage('Compile'){
agent any
steps{
sh 'mvn compile'
}
}
stage('CodeReview'){
agent any
steps{
sh 'mvn pmd:pmd'
}
post{
always{
pmd pattern: 'target/pmd.xml'
}
}
}
stage('UnitTest'){
agent {label 'win_slave'}
steps{
git 'https://github.com/devops-trainer/DevOpsClassCodes.git'
bat 'mvn test'
}
post{
always{
junit 'target/surefire-reports/*.xml'
}
}

}
stage('MetricCheck'){
agent any
steps{
sh 'mvn cobertura:cobertura -Dcobertura.report.format=xml'
}
post{
always{
cobertura coberturaReportFile: 'target/site/cobertura/coverage.xml'
}
}
}
stage('Package'){
agent any
steps{
sh 'mvn package'
}
}
}
}