bidon/Jenkinsfile

36 lines
1.1 KiB
Groovy

@Library('eo-jenkins-lib@master') import eo.Utils
pipeline {
agent any
stages {
stage('unit test') {
steps {
sh 'tox -r -- --junitxml=test_results.xml --cov-report xml --cov-report html --cov=bidon/ tests/'
}
}
stage('Packaging') {
steps {
script {
if (env.JOB_NAME == 'bidon' && env.GIT_BRANCH == 'origin/master') {
sh 'sudo -H -u eobuilder /usr/local/bin/eobuilder bidon'
} else if (env.GIT_BRANCH.startsWith('hotfix/')) {
sh "sudo -H -u eobuilder /usr/local/bin/eobuilder -d stretch --branch ${env.GIT_BRANCH} --hotfix bidon"
}
}
}
}
}
post {
always {
sh 'printenv'
script {
utils = new Utils()
utils.mail_notify(currentBuild, env, 'admin+jenkins-bidon@entrouvert.com')
utils.publish_coverage('coverage.xml')
utils.publish_coverage_native('coverage.html')
}
junit 'test_results.xml'
}
}
}