add Jenkinsfile

This commit is contained in:
Emmanuel Cazenave 2019-10-01 15:04:36 +02:00
parent a142e4f974
commit f64f7b1c11
2 changed files with 48 additions and 4 deletions

44
Jenkinsfile vendored Normal file
View File

@ -0,0 +1,44 @@
@Library('eo-jenkins-lib@master') import eo.Utils
pipeline {
agent any
stages {
stage('Unit Tests') {
steps {
sh 'tox -r'
}
post {
always {
script {
utils = new Utils()
utils.publish_coverage('coverage.xml')
utils.publish_coverage_native('index.html')
}
junit '*_results.xml'
}
}
}
stage('Packaging') {
steps {
script {
if (env.JOB_NAME == 'corbo' && env.GIT_BRANCH == 'origin/master') {
sh 'sudo -H -u eobuilder /usr/local/bin/eobuilder -d stretch corbo'
} else if (env.GIT_BRANCH.startsWith('hotfix/')) {
sh "sudo -H -u eobuilder /usr/local/bin/eobuilder -d stretch --branch ${env.GIT_BRANCH} --hotfix corbo"
}
}
}
}
}
post {
always {
script {
utils = new Utils()
utils.mail_notify(currentBuild, env, 'admin+jenkins-corbo@entrouvert.com')
}
}
success {
cleanWs()
}
}
}

View File

@ -1,16 +1,16 @@
[tox]
envlist = coverage-django18,coverage-django111
envlist = coverage-django111
[testenv]
basepython = python2
usedevelop =
coverage: True
setenv =
DJANGO_SETTINGS_MODULE=corbo.settings
CORBO_SETTINGS_FILE=tests/settings.py
coverage: COVERAGE=--junitxml=test_results.xml --cov-report xml --cov=corbo/ --cov-config .coveragerc
coverage: COVERAGE=--junitxml=test_results.xml --cov-report xml --cov-report html --cov=corbo/ --cov-config .coveragerc
deps =
django18: django>=1.8,<1.9
django111: django>=1.11,<1.12
django>=1.11,<1.12
http://git.entrouvert.org/hobo.git/snapshot/hobo-master.tar.gz
pytest-cov
pytest-django>=3.1.1,<3.4.6