diff --git a/Jenkinsfile b/Jenkinsfile index 71e2ee3..4d1a6cc 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -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() } }