use new Jenksinfile (#33811)

This commit is contained in:
Benjamin Dauvergne 2019-06-08 09:20:13 +02:00
parent 64783e77ea
commit 549aa8ee95
2 changed files with 24 additions and 23 deletions

45
Jenkinsfile vendored
View File

@ -2,30 +2,33 @@
pipeline {
agent any
options { disableConcurrentBuilds() }
options {
disableConcurrentBuilds()
skipDefaultCheckout()
}
environment {
TMPDIR = "/tmp/$BUILD_TAG"
TMPDIR = "$WORKSPACE"
}
stages {
stage('Unit Tests') {
steps {
sh "mkdir ${env.TMPDIR}"
sh """
virtualenv -p python3 ${env.TMPDIR}/venv/
. ${env.TMPDIR}/venv/bin/activate
${env.TMPDIR}/venv/bin/pip install tox
PGPORT=`python -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 -rv"""
cleanWs()
dir ("repository") {
checkout scm
tox()
}
}
post {
always {
script {
utils = new Utils()
utils.publish_coverage('coverage.xml')
utils.publish_coverage_native('index.html')
utils.publish_pylint('pylint.out')
dir("repository") {
script {
utils = new Utils()
utils.publish_coverage('coverage.xml')
utils.publish_coverage_native('index.html')
utils.publish_pylint('pylint.out')
}
mergeJunitResults()
}
sh './merge-junit-results.py junit-*.xml >junit.xml'
junit 'junit.xml'
}
}
}
@ -41,14 +44,12 @@ PGPORT=`python -c 'import struct; import socket; s=socket.socket(); s.setsockopt
}
post {
always {
script {
utils = new Utils()
utils.mail_notify(currentBuild, env, 'admin+jenkins-authentic2-auth-kerberos@entrouvert.com')
dir("repository") {
script {
utils = new Utils()
utils.mail_notify(currentBuild, env, 'admin+jenkins-authentic2-auth-kerberos@entrouvert.com')
}
}
}
success {
sh "rm -rf ${env.TMPDIR}"
cleanWs()
}
}
}

View File

@ -5,7 +5,7 @@
[tox]
toxworkdir = {env:TMPDIR:/tmp}/tox-{env:USER}/authentic2-auth-kerberos/{env:BRANCH_NAME:}
toxworkdir = {env:TMPDIR:/tmp}/tox-{env:USER}/authentic2-auth-kerberos/
envlist = py27-coverage-{dj18,dj111}-{pg,sqlite}-{oldldap,},pylint
[testenv]