summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEmmanuel Cazenave <ecazenave@entrouvert.com>2018-10-03 07:28:32 (GMT)
committerEmmanuel Cazenave <ecazenave@entrouvert.com>2018-10-03 08:23:40 (GMT)
commitae9bb817f15b398d5ee5bddb8d113f655af6a9f0 (patch)
tree77f8d06853c2e3e5dbe42153e4df0b473a7242f8
parent231d75f34c7ec13b73883e87e14d2a192ee40346 (diff)
downloadeopayment-ae9bb817f15b398d5ee5bddb8d113f655af6a9f0.zip
eopayment-ae9bb817f15b398d5ee5bddb8d113f655af6a9f0.tar.gz
eopayment-ae9bb817f15b398d5ee5bddb8d113f655af6a9f0.tar.bz2
create a Jenkinsfile (#26940)
-rw-r--r--Jenkinsfile35
-rw-r--r--tox.ini8
2 files changed, 40 insertions, 3 deletions
diff --git a/Jenkinsfile b/Jenkinsfile
new file mode 100644
index 0000000..3657da2
--- /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 == 'eopayment' && env.GIT_BRANCH == 'origin/master') {
+ sh 'sudo -H -u eobuilder /usr/local/bin/eobuilder eopayment'
+ }
+ }
+ }
+ }
+ }
+ post {
+ always {
+ script {
+ utils = new Utils()
+ utils.mail_notify(currentBuild, env, 'admin+jenkins-eopayment@entrouvert.com')
+ utils.publish_coverage('coverage.xml')
+ utils.publish_coverage_native('index.html')
+ }
+ junit '*_results.xml'
+ }
+ success {
+ cleanWs()
+ }
+ }
+}
diff --git a/tox.ini b/tox.ini
index 61acc97..7a7f70e 100644
--- a/tox.ini
+++ b/tox.ini
@@ -5,13 +5,15 @@
[tox]
envlist = py2,py3
-toxworkdir = {env:TMPDIR:/tmp}/tox-{env:USER}/eopayment/
+toxworkdir = {env:TMPDIR:/tmp}/tox-{env:USER}/eopayment/{env:BRANCH_NAME:}
[testenv]
# django.contrib.auth is not tested it does not work with our templates
+basepython = python2
commands =
- py.test --junitxml=junit.xml --cov-report xml --cov=eopayment/ tests
+ py2: py.test {posargs: --junitxml=test_{envname}_results.xml --cov-report xml --cov-report html --cov=eopayment/ tests}
+ py3: py.test {posargs: --junitxml=test_{envname}_results.xml tests}
usedevelop = True
deps = coverage
pytest
- pytest-cov
+ py2: pytest-cov