passerelle/Jenkinsfile

50 lines
1.5 KiB
Groovy

@Library('eo-jenkins-lib@main') import eo.Utils
pipeline {
agent any
options {
disableConcurrentBuilds()
timeout(time: 30, unit: 'MINUTES')
}
stages {
stage('Unit Tests') {
steps {
sh 'NUMPROCESSES=6 tox -rv '
}
post {
always {
script {
utils = new Utils()
utils.publish_coverage('coverage.xml')
utils.publish_coverage_native('index.html')
utils.publish_pylint('pylint.out')
}
mergeJunitResults()
}
}
}
stage('Packaging') {
steps {
script {
if (env.JOB_NAME == 'passerelle' && env.GIT_BRANCH == 'origin/main') {
sh 'sudo -H -u eobuilder /usr/local/bin/eobuilder -d bullseye passerelle'
} else if (env.GIT_BRANCH.startsWith('hotfix/')) {
sh "sudo -H -u eobuilder /usr/local/bin/eobuilder -d bullseye --branch ${env.GIT_BRANCH} --hotfix passerelle"
}
}
}
}
}
post {
always {
script {
utils = new Utils()
utils.mail_notify(currentBuild, env, 'ci+jenkins-passerelle@entrouvert.org')
}
}
success {
cleanWs()
}
}
}