use new Jenksinfile (#33811)
This commit is contained in:
parent
64783e77ea
commit
549aa8ee95
|
@ -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()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue