diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 00000000..c0376e68 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,43 @@ +@Library('eo-jenkins-lib@master') import eo.Utils + +pipeline { + agent any + stages { + stage('Unit Tests') { + steps { + sh 'tox -rv' + } + post { + always { + script { + utils = new Utils() + utils.publish_coverage('coverage.xml') + utils.publish_coverage_native('index.html') + utils.publish_pylint('pylint.out') + } + junit '*_results.xml' + } + } + } + stage('Packaging') { + steps { + script { + if (env.JOB_NAME == 'chrono' && env.GIT_BRANCH == 'origin/master') { + sh 'sudo -H -u eobuilder /usr/local/bin/eobuilder chrono' + } + } + } + } + } + post { + always { + script { + utils = new Utils() + utils.mail_notify(currentBuild, env, 'admin+jenkins-chrono@entrouvert.com') + } + } + success { + cleanWs() + } + } +} diff --git a/tox.ini b/tox.ini index 0ec93ef9..ca59e91d 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,6 @@ [tox] envlist = py2-coverage-django18-pylint,{py2,py3}-coverage-django111 -toxworkdir = {env:TMPDIR:/tmp}/tox-{env:USER}/chrono/ +toxworkdir = {env:TMPDIR:/tmp}/tox-{env:USER}/chrono/{env:BRANCH_NAME:} [testenv] usedevelop = @@ -9,7 +9,7 @@ usedevelop = setenv = DJANGO_SETTINGS_MODULE=chrono.settings CHRONO_SETTINGS_FILE=tests/settings.py - coverage: COVERAGE=--junitxml=test_results.xml --cov-report xml --cov=chrono/ + coverage: COVERAGE=--junitxml=test_results.xml --cov-report xml --cov-report html --cov=chrono/ deps = django18: django>=1.8,<1.9 django111: django>=1.11,<1.12