barbacompta/Jenkinsfile

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

55 lines
1.7 KiB
Plaintext
Raw Permalink Normal View History

2020-12-26 15:21:15 +01:00
@Library('eo-jenkins-lib@main') import eo.Utils
2019-02-17 11:33:59 +01:00
pipeline {
agent any
options {
disableConcurrentBuilds()
timeout(time: 20, unit: 'MINUTES')
2020-08-31 11:16:08 +02:00
}
2021-11-24 12:09:57 +01:00
environment {
TMPDIR = "${sh(returnStdout: true, script: "mktemp -d").trim()}"
}
2019-02-17 11:33:59 +01:00
stages {
stage('Unit Tests') {
steps {
2021-11-24 12:09:57 +01:00
sh """
python3 -m venv ${env.TMPDIR}/venv/
${env.TMPDIR}/venv/bin/pip install tox
PGPORT=`python3 -c 'import struct; import socket; s=socket.socket(); s.setsockopt(socket.SOL_SOCKET, socket.SO_LINGER, struct.pack("ii", 1, 0)); s.bind(("", 0)); print(s.getsockname()[1]); s.close()'` pg_virtualenv -o fsync=off ${env.TMPDIR}/venv/bin/tox -r --workdir ${env.TMPDIR}/tox/"""
2019-02-17 11:33:59 +01:00
}
post {
always {
script {
utils = new Utils()
utils.publish_coverage('coverage.xml')
utils.publish_coverage_native('index.html')
utils.publish_pylint('pylint.out')
}
mergeJunitResults()
2019-02-17 11:33:59 +01:00
}
}
}
stage('Packaging') {
steps {
script {
2020-12-26 15:21:15 +01:00
if (env.JOB_NAME == 'barbacompta' && env.GIT_BRANCH == 'origin/main') {
sh 'sudo -H -u eobuilder /usr/local/bin/eobuilder -d buster,bullseye barbacompta'
2019-02-17 11:33:59 +01:00
}
}
}
}
}
post {
always {
script {
utils = new Utils()
utils.mail_notify(currentBuild, env, 'ci+jenkins-barbacompta@entrouvert.org')
2019-02-17 11:33:59 +01:00
}
}
cleanup {
2021-11-24 12:09:57 +01:00
sh "rm -rf ${env.TMPDIR}"
2019-02-17 11:33:59 +01:00
cleanWs()
}
}
}