2020-12-26 15:21:15 +01:00
|
|
|
@Library('eo-jenkins-lib@main') import eo.Utils
|
2019-01-16 10:56:16 +01:00
|
|
|
|
|
|
|
pipeline {
|
|
|
|
agent any
|
2019-03-12 19:19:08 +01:00
|
|
|
options { disableConcurrentBuilds() }
|
2019-01-16 10:56:16 +01:00
|
|
|
stages {
|
|
|
|
stage('Unit Tests') {
|
|
|
|
steps {
|
2020-02-21 11:22:43 +01:00
|
|
|
sh 'tox -rv'
|
2019-01-16 10:56:16 +01:00
|
|
|
}
|
|
|
|
post {
|
|
|
|
always {
|
|
|
|
script {
|
|
|
|
utils = new Utils()
|
|
|
|
utils.publish_coverage('coverage-*.xml')
|
|
|
|
utils.publish_coverage_native(
|
2021-01-12 14:52:39 +01:00
|
|
|
'index.html', 'htmlcov-py3-django22-coverage-authentic', 'Coverage authentic tests')
|
2019-01-16 10:56:16 +01:00
|
|
|
utils.publish_coverage_native(
|
2021-01-12 14:52:39 +01:00
|
|
|
'index.html', 'htmlcov-py3-django22-coverage-hobo', 'Coverage hobo tests')
|
2019-01-16 10:56:16 +01:00
|
|
|
utils.publish_coverage_native(
|
2021-01-12 14:52:39 +01:00
|
|
|
'index.html', 'htmlcov-py3-django22-coverage-multipublik', 'Coverage multipublik tests')
|
2019-01-16 10:56:16 +01:00
|
|
|
utils.publish_coverage_native(
|
2021-01-12 14:52:39 +01:00
|
|
|
'index.html', 'htmlcov-py3-django22-coverage-multitenant', 'Coverage multitenant tests')
|
2019-01-16 10:56:16 +01:00
|
|
|
utils.publish_coverage_native(
|
2021-01-12 14:52:39 +01:00
|
|
|
'index.html', 'htmlcov-py3-django22-coverage-passerelle', 'Coverage passerelle tests')
|
2019-01-16 10:56:16 +01:00
|
|
|
utils.publish_pylint('pylint.out')
|
|
|
|
}
|
2019-12-09 15:33:28 +01:00
|
|
|
mergeJunitResults()
|
2019-01-16 10:56:16 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
stage('Packaging') {
|
|
|
|
steps {
|
|
|
|
script {
|
2020-12-26 15:21:15 +01:00
|
|
|
if (env.JOB_NAME == 'hobo' && env.GIT_BRANCH == 'origin/main') {
|
2021-12-03 16:54:19 +01:00
|
|
|
sh 'sudo -H -u eobuilder /usr/local/bin/eobuilder -d buster,bullseye hobo'
|
2019-07-02 14:27:18 +02:00
|
|
|
} else if (env.GIT_BRANCH.startsWith('hotfix/')) {
|
2021-12-03 16:54:19 +01:00
|
|
|
sh "sudo -H -u eobuilder /usr/local/bin/eobuilder -d buster,bullseye --branch ${env.GIT_BRANCH} --hotfix hobo"
|
2019-01-16 10:56:16 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
post {
|
|
|
|
always {
|
|
|
|
script {
|
|
|
|
utils = new Utils()
|
|
|
|
utils.mail_notify(currentBuild, env, 'admin+jenkins-hobo@entrouvert.com')
|
|
|
|
}
|
|
|
|
}
|
|
|
|
success {
|
|
|
|
cleanWs()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|