build: add jenkinsfile

This commit is contained in:
Frédéric Péters 2019-03-31 15:08:41 +02:00
parent 5525766c9f
commit 675064348e
2 changed files with 45 additions and 2 deletions

43
Jenkinsfile vendored Normal file
View File

@ -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()
}
}
}

View File

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