59 lines
2.2 KiB
Groovy
59 lines
2.2 KiB
Groovy
@Library('eo-jenkins-lib@main') import eo.Utils
|
|
|
|
pipeline {
|
|
agent any
|
|
options {
|
|
disableConcurrentBuilds()
|
|
timeout(time: 60, unit: 'MINUTES')
|
|
}
|
|
stages {
|
|
stage('Unit Tests') {
|
|
steps {
|
|
sh 'tox -rv -p 8'
|
|
}
|
|
post {
|
|
always {
|
|
script {
|
|
utils = new Utils()
|
|
utils.publish_coverage('coverage-*.xml')
|
|
utils.publish_coverage_native(
|
|
'index.html', 'htmlcov-py3-django22-drf312-coverage-authentic', 'Coverage authentic tests')
|
|
utils.publish_coverage_native(
|
|
'index.html', 'htmlcov-py3-django22-drf312-coverage-hobo', 'Coverage hobo tests')
|
|
utils.publish_coverage_native(
|
|
'index.html', 'htmlcov-py3-django22-drf312-coverage-multipublik', 'Coverage multipublik tests')
|
|
utils.publish_coverage_native(
|
|
'index.html', 'htmlcov-py3-django22-drf312-coverage-multitenant', 'Coverage multitenant tests')
|
|
utils.publish_coverage_native(
|
|
'index.html', 'htmlcov-py3-django22-drf312-coverage-passerelle', 'Coverage passerelle tests')
|
|
utils.publish_pylint('pylint.out')
|
|
}
|
|
mergeJunitResults()
|
|
}
|
|
}
|
|
}
|
|
stage('Packaging') {
|
|
steps {
|
|
script {
|
|
if (env.JOB_NAME == 'hobo' && env.GIT_BRANCH == 'origin/main') {
|
|
sh 'sudo -H -u eobuilder /usr/local/bin/eobuilder -d buster,bullseye hobo'
|
|
} else if (env.GIT_BRANCH.startsWith('hotfix/')) {
|
|
sh "sudo -H -u eobuilder /usr/local/bin/eobuilder -d buster,bullseye --branch ${env.GIT_BRANCH} --hotfix hobo"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
post {
|
|
always {
|
|
script {
|
|
utils = new Utils()
|
|
utils.mail_notify(currentBuild, env, 'admin+jenkins-hobo@entrouvert.com')
|
|
}
|
|
}
|
|
success {
|
|
cleanWs()
|
|
}
|
|
}
|
|
}
|