jenkins: get back to an unusual Jenkinsfile (#61949)

This commit is contained in:
Frédéric Péters 2022-02-18 10:18:45 +01:00
parent f420f99b72
commit 2cfaa9be97
1 changed files with 7 additions and 10 deletions

17
Jenkinsfile vendored
View File

@ -2,18 +2,14 @@
pipeline {
agent any
options { disableConcurrentBuilds() }
environment {
TMPDIR = "/tmp/$BUILD_TAG"
options {
disableConcurrentBuilds()
timeout(time: 20, unit: 'MINUTES')
}
stages {
stage('Unit Tests') {
steps {
sh "mkdir ${env.TMPDIR}"
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"""
sh 'tox -rv'
}
post {
always {
@ -32,6 +28,8 @@ PGPORT=`python3 -c 'import struct; import socket; s=socket.socket(); s.setsockop
script {
if (env.JOB_NAME == 'authentic2-auth-fedict' && env.GIT_BRANCH == 'origin/main') {
sh 'sudo -H -u eobuilder /usr/local/bin/eobuilder -d buster,bullseye authentic2-auth-fedict'
} else if (env.GIT_BRANCH.startsWith('hotfix/')) {
sh "sudo -H -u eobuilder /usr/local/bin/eobuilder -d buster,bullseye --branch ${env.GIT_BRANCH} --hotfix authentic2-auth-fedict"
}
}
}
@ -44,8 +42,7 @@ PGPORT=`python3 -c 'import struct; import socket; s=socket.socket(); s.setsockop
utils.mail_notify(currentBuild, env, 'ci+jenkins-authentic2-auth-fedict@entrouvert.org')
}
}
cleanup {
sh "find ${env.TMPDIR} -type f -delete; rm -rf ${env.TMPDIR}"
success {
cleanWs()
}
}