41 lines
1.6 KiB
Groovy
41 lines
1.6 KiB
Groovy
pipeline {
|
|
agent any
|
|
stages{
|
|
stage('unit test'){
|
|
steps{
|
|
sh 'tox -r -- --junitxml=test_results.xml --cov-report xml --cov=bidon/ tests/'
|
|
}
|
|
}
|
|
stage('packaging'){
|
|
steps{
|
|
script {
|
|
if (env.BRANCH_NAME == 'master') {
|
|
sh 'sudo -H -u eobuilder /usr/local/bin/eobuilder -d jessie bidon'
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
post {
|
|
always {
|
|
junit 'test_results.xml'
|
|
step([$class: 'CoberturaPublisher', autoUpdateHealth: false, autoUpdateStability: false, coberturaReportFile: '**/coverage.xml', failUnhealthy: false, failUnstable: false, maxNumberOfBuilds: 0, onlyStable: false, sourceEncoding: 'ASCII', zoomCoverageChart: false])
|
|
script {
|
|
// Hack to have the 'jenkins build back to normal' mail sent
|
|
if (currentBuild.result == null) {
|
|
currentBuild.result = 'SUCCESS'
|
|
}
|
|
if (env.BRANCH_NAME == 'master') {
|
|
step([$class: 'Mailer', notifyEveryUnstableBuild: true,
|
|
recipients: "manukaz@gmail.com", sendToIndividuals: true])
|
|
} else {
|
|
step([$class: 'Mailer',
|
|
notifyEveryUnstableBuild: true,
|
|
recipients: emailextrecipients([[$class: 'CulpritsRecipientProvider'],
|
|
[$class: 'RequesterRecipientProvider']])])
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|