create a Jenkinsfile (#26940)
This commit is contained in:
parent
231d75f34c
commit
ae9bb817f1
|
@ -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()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
8
tox.ini
8
tox.ini
|
@ -5,13 +5,15 @@
|
||||||
|
|
||||||
[tox]
|
[tox]
|
||||||
envlist = py2,py3
|
envlist = py2,py3
|
||||||
toxworkdir = {env:TMPDIR:/tmp}/tox-{env:USER}/eopayment/
|
toxworkdir = {env:TMPDIR:/tmp}/tox-{env:USER}/eopayment/{env:BRANCH_NAME:}
|
||||||
|
|
||||||
[testenv]
|
[testenv]
|
||||||
# django.contrib.auth is not tested it does not work with our templates
|
# django.contrib.auth is not tested it does not work with our templates
|
||||||
|
basepython = python2
|
||||||
commands =
|
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
|
usedevelop = True
|
||||||
deps = coverage
|
deps = coverage
|
||||||
pytest
|
pytest
|
||||||
pytest-cov
|
py2: pytest-cov
|
||||||
|
|
Loading…
Reference in New Issue