Skip to content

Commit

Permalink
Added separate jenkinsfile for coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
andreaceccanti committed Jun 14, 2017
1 parent 0fb7192 commit 4ba9783
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions jenkins/Jenkinsfile.coverage
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
pipeline {
agent { label 'maven' }

options {
timeout(time: 1, unit: 'HOURS')
buildDiscarder(logRotator(numToKeepStr: '5'))
}

stages {
stage('checkout') {
steps {
git(url: 'https://github.com/indigo-iam/iam.git', branch: env.BRANCH_NAME)
stash name: 'code', useDefaultExcludes: false
}
}

stage('coverage') {
steps {
unstash 'code'
sh 'mvn -B clean cobertura:cobertura'

publishHTML(target: [
reportName : 'Cobertura Report',
reportDir : 'iam-login-service/target/site/cobertura/',
reportFiles : 'index.html',
keepAll : true,
alwaysLinkToLastBuild: true,
allowMissing : false
])
}
}
}

post {
success {
slackSend channel: "#iam", color: 'good', message: "${env.JOB_NAME} - #${env.BUILD_NUMBER} Success (<${env.BUILD_URL}|Open>)"
}

unstable {
slackSend channel: "#iam", color: 'danger', message: "${env.JOB_NAME} - #${env.BUILD_NUMBER} Unstable (<${env.BUILD_URL}|Open>)"
}

failure {
slackSend channel: "#iam", color: 'danger', message: "${env.JOB_NAME} - #${env.BUILD_NUMBER} Failure (<${env.BUILD_URL}|Open>)"
}
}
}

0 comments on commit 4ba9783

Please sign in to comment.