pipeline first try

This commit is contained in:
Emmanuel Cazenave 2018-04-25 17:05:37 +02:00
parent 9b4d54e721
commit 350144d2ce
4 changed files with 41 additions and 14 deletions

31
Jenkinsfile vendored Normal file
View File

@ -0,0 +1,31 @@
@Library('eo-jenkins-lib@v0.1') import eo.Utils
pipeline {
agent any
stages{
stage('unit test'){
steps{
sh './jenkins.sh'
}
}
stage('packaging'){
steps{
script {
if (env.BRANCH_NAME == 'master') {
sh 'sudo -H -u eobuilder /usr/local/bin/eobuilder -d jessie,stretch combo'
}
}
}
}
}
post {
always {
junit 'test_results.xml'
script {
utils = new Utils()
utils.publish_cobertura_report('**/coverage.xml')
utils.mail_notify(currentBuild, env, 'admin+jenkins-combo@entrouvert.com')
}
}
}
}

View File

@ -1,13 +1,12 @@
#!/bin/sh
#!/bin/sh -xue
set -e
rm -f pylint.out
rm -f coverage.xml
rm -f test_results.xml
virtualenv --python=python2.7 jenkins_venv
. jenkins_venv/bin/activate
test -d wcs || git clone http://git.entrouvert.org/wcs.git
(cd wcs && git pull)
pip install --upgrade tox
tox -rv
pip install --upgrade tox pylint pylint-django
./pylint.sh combo/
tox -rv -- --junitxml=test_results.xml --cov-report xml --cov=combo/

View File

@ -8,9 +8,7 @@ elif [ -f pylint.django.rc ]; then
PYLINT_RC=pylint.django.rc
else
echo No pylint RC found
exit 0
exit 1
fi
test -f pylint.out && cp pylint.out pylint.out.prev
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

View File

@ -1,6 +1,5 @@
[tox]
envlist = coverage-{django18,django111}-pylint
toxworkdir = {env:TMPDIR:/tmp}/tox-{env:USER}/combo/
envlist = django18,django111
[testenv]
usedevelop = True
@ -24,5 +23,5 @@ deps =
quixote<3.0
vobject
commands =
py.test {env:COVERAGE:} {posargs:tests/}
pylint: ./pylint.sh combo/
py.test {posargs:tests/}
./pylint.sh combo/