create a Jenkinsfile (#24646)
This commit is contained in:
parent
ced979f0ae
commit
690c048f18
|
@ -0,0 +1,36 @@
|
||||||
|
@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 == 'passerelle' && env.GIT_BRANCH == 'origin/master') {
|
||||||
|
sh 'sudo -H -u eobuilder /usr/local/bin/eobuilder -d jessie,stretch passerelle'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
post {
|
||||||
|
always {
|
||||||
|
script {
|
||||||
|
utils = new Utils()
|
||||||
|
utils.mail_notify(currentBuild, env, 'admin+jenkins-passerelle@entrouvert.com')
|
||||||
|
utils.publish_coverage('coverage.xml')
|
||||||
|
utils.publish_coverage_native('index.html')
|
||||||
|
utils.publish_pylint('pylint.out')
|
||||||
|
}
|
||||||
|
junit '*_results.xml'
|
||||||
|
}
|
||||||
|
success {
|
||||||
|
cleanWs()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -10,7 +10,4 @@ else
|
||||||
echo No pylint RC found
|
echo No pylint RC found
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
test -f pylint.out && cp pylint.out pylint.out.prev
|
|
||||||
pylint -f parseable --rcfile ${PYLINT_RC} "$@" | tee pylint.out || /bin/true
|
pylint -f parseable --rcfile ${PYLINT_RC} "$@" | tee pylint.out || /bin/true
|
||||||
test -f pylint.out.prev && (diff pylint.out.prev pylint.out | grep '^[><]' | grep .py) || /bin/true
|
|
||||||
|
|
14
tox.ini
14
tox.ini
|
@ -1,15 +1,14 @@
|
||||||
[tox]
|
[tox]
|
||||||
envlist = coverage-{django18,django111}-pylint
|
toxworkdir = {env:TMPDIR:/tmp}/tox-{env:USER}/passerelle/{env:BRANCH_NAME:}
|
||||||
toxworkdir = {env:TMPDIR:/tmp}/tox-{env:USER}/passerelle/
|
envlist = django{18,111}
|
||||||
|
|
||||||
[testenv]
|
[testenv]
|
||||||
usedevelop =
|
usedevelop = True
|
||||||
coverage: True
|
basepython = python2
|
||||||
setenv =
|
setenv =
|
||||||
DJANGO_SETTINGS_MODULE=passerelle.settings
|
DJANGO_SETTINGS_MODULE=passerelle.settings
|
||||||
PASSERELLE_SETTINGS_FILE=tests/settings.py
|
PASSERELLE_SETTINGS_FILE=tests/settings.py
|
||||||
fast: FAST=--nomigrations
|
fast: FAST=--nomigrations
|
||||||
coverage: COVERAGE=--junitxml=test_results.xml --cov-report xml --cov=passerelle/ --cov-config .coveragerc
|
|
||||||
deps =
|
deps =
|
||||||
django18: django>=1.8,<1.9
|
django18: django>=1.8,<1.9
|
||||||
django111: django>=1.11,<1.12
|
django111: django>=1.11,<1.12
|
||||||
|
@ -26,5 +25,6 @@ deps =
|
||||||
lxml
|
lxml
|
||||||
mohawk
|
mohawk
|
||||||
commands =
|
commands =
|
||||||
py.test {env:FAST:} {env:COVERAGE:} {posargs:tests/}
|
django18: py.test {posargs: {env:FAST:} --junitxml=test_{envname}_results.xml --cov-report xml --cov-report html --cov=passerelle/ --cov-config .coveragerc tests/}
|
||||||
pylint: ./pylint.sh passerelle/
|
django18: ./pylint.sh passerelle/
|
||||||
|
django111: py.test {posargs: --junitxml=test_{envname}_results.xml tests/}
|
||||||
|
|
Loading…
Reference in New Issue