create a Jenkinsfile (#26226)

and test on django 1.11
This commit is contained in:
Emmanuel Cazenave 2018-09-07 14:33:32 +02:00
parent 75120c3d21
commit 2057998b3a
3 changed files with 40 additions and 12 deletions

35
Jenkinsfile vendored Normal file
View File

@ -0,0 +1,35 @@
@Library('eo-jenkins-lib@master') import eo.Utils
pipeline {
agent any
stages {
stage('Unit Tests') {
steps {
sh 'tox -rv'
}
}
stage('Packaging') {
steps {
script {
if (env.JOB_NAME == 'combo' && env.GIT_BRANCH == 'origin/master') {
sh 'sudo -H -u eobuilder /usr/local/bin/eobuilder -d jessie,stretch bijoe'
}
}
}
}
}
post {
always {
script {
utils = new Utils()
utils.mail_notify(currentBuild, env, 'admin+jenkins-bijoe@entrouvert.com')
utils.publish_coverage('coverage.xml')
utils.publish_coverage_native('index.html')
}
junit '*_results.xml'
}
success {
cleanWs()
}
}
}

View File

@ -1,9 +0,0 @@
#!/bin/sh
set -e
rm -f coverage.xml
rm -f test_results.xml
pip install --upgrade tox
tox -r -e coverage-{dj18,dj19,dj110}

View File

@ -4,11 +4,12 @@
# and then run "tox" from this directory.
[tox]
toxworkdir = {env:TMPDIR:/tmp}/tox-{env:USER}/bijoe/
toxworkdir = {env:TMPDIR:/tmp}/tox-{env:USER}/bijoe/{env:BRANCH_NAME:}
envlist = dj18,dj111
[testenv]
usedevelop = true
basepython = python2
setenv =
DJANGO_SETTINGS_MODULE=bijoe.settings
coverage: COVERAGE=--junit-xml=test_results.xml --cov=bijoe --cov-report xml
@ -24,6 +25,7 @@ deps =
pytest-random
pytest-django
WebTest
dj18,dj19,dj110: django-webtest<1.9.3
django-webtest<1.9.3
commands =
py.test {env:COVERAGE:} {posargs:--nomigrations --random tests}
dj111: py.test {posargs: --junitxml=test_{envname}_results.xml --cov-report xml --cov-report html --cov=bijoe --random tests/}
dj18: py.test {posargs: --junitxml=test_{envname}_results.xml --random tests/}