summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEmmanuel Cazenave <ecazenave@entrouvert.com>2018-09-07 12:33:32 (GMT)
committerEmmanuel Cazenave <ecazenave@entrouvert.com>2018-09-07 12:45:19 (GMT)
commit2057998b3aa7a433cdef99ca039f3d502cac6ed8 (patch)
treeaf2c8aeacaf58d63446425de49c40d7a56c46427
parent75120c3d219280b561aaf46ef0dbd8954d884ac0 (diff)
downloadbijoe-2057998b3aa7a433cdef99ca039f3d502cac6ed8.zip
bijoe-2057998b3aa7a433cdef99ca039f3d502cac6ed8.tar.gz
bijoe-2057998b3aa7a433cdef99ca039f3d502cac6ed8.tar.bz2
create a Jenkinsfile (#26226)
and test on django 1.11
-rw-r--r--Jenkinsfile35
-rwxr-xr-xjenkins.sh9
-rw-r--r--tox.ini8
3 files changed, 40 insertions, 12 deletions
diff --git a/Jenkinsfile b/Jenkinsfile
new file mode 100644
index 0000000..b9c2ebb
--- /dev/null
+++ b/Jenkinsfile
@@ -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()
+ }
+ }
+}
diff --git a/jenkins.sh b/jenkins.sh
deleted file mode 100755
index 2537258..0000000
--- a/jenkins.sh
+++ /dev/null
@@ -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}
diff --git a/tox.ini b/tox.ini
index 8db2c75..d843d92 100644
--- a/tox.ini
+++ b/tox.ini
@@ -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/}