create a Jenkinsfile (#26940)

This commit is contained in:
Emmanuel Cazenave 2018-10-03 09:28:32 +02:00
parent 231d75f34c
commit ae9bb817f1
2 changed files with 40 additions and 3 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 == '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()
}
}
}

View File

@ -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