54 lines
1.6 KiB
Groovy
54 lines
1.6 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 """
|
|
python3 -m venv ./venv/
|
|
./venv/bin/pip install "tox"
|
|
./venv/bin/tox run-parallel --workdir ./tox-workdir --recreate --parallel 8 --parallel-no-spinner
|
|
./venv/bin/tox run -e coverage-report"""
|
|
}
|
|
post {
|
|
always {
|
|
script {
|
|
utils = new Utils()
|
|
utils.publish_coverage('coverage.xml')
|
|
utils.publish_coverage_native('index.html', 'htmlcov', 'Coverage')
|
|
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 bullseye hobo'
|
|
} else if (env.GIT_BRANCH.startsWith('hotfix/')) {
|
|
sh "sudo -H -u eobuilder /usr/local/bin/eobuilder -d bullseye --branch ${env.GIT_BRANCH} --hotfix hobo"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
post {
|
|
always {
|
|
script {
|
|
utils = new Utils()
|
|
utils.mail_notify(currentBuild, env, 'ci+jenkins-hobo@entrouvert.org')
|
|
}
|
|
}
|
|
success {
|
|
cleanWs()
|
|
}
|
|
}
|
|
}
|