use a Jenkinsfile (#29776)
This commit is contained in:
parent
ffaeb45057
commit
1c7a6693e5
|
@ -0,0 +1,62 @@
|
|||
@Library('eo-jenkins-lib@master') import eo.Utils
|
||||
|
||||
pipeline {
|
||||
agent any
|
||||
stages {
|
||||
stage('Unit Tests') {
|
||||
steps {
|
||||
sh './jenkins.sh'
|
||||
}
|
||||
post {
|
||||
always {
|
||||
script {
|
||||
utils = new Utils()
|
||||
utils.publish_coverage('coverage-*.xml')
|
||||
utils.publish_coverage_native(
|
||||
'index.html', 'htmlcov-coverage-django18-authentic', 'Coverage authentic tests')
|
||||
utils.publish_coverage_native(
|
||||
'index.html', 'htmlcov-coverage-django18-hobo', 'Coverage hobo tests')
|
||||
utils.publish_coverage_native(
|
||||
'index.html', 'htmlcov-coverage-django18-authentic', 'Coverage multipublik tests')
|
||||
utils.publish_coverage_native(
|
||||
'index.html', 'htmlcov-coverage-django18-authentic', 'Coverage multitenant tests')
|
||||
utils.publish_coverage_native(
|
||||
'index.html', 'htmlcov-coverage-django18-authentic', 'Coverage passerelle tests')
|
||||
utils.publish_coverage_native(
|
||||
'index.html', 'htmlcov-coverage-django111-authentic', 'Coverage authentic tests')
|
||||
utils.publish_coverage_native(
|
||||
'index.html', 'htmlcov-coverage-django111-hobo', 'Coverage hobo tests')
|
||||
utils.publish_coverage_native(
|
||||
'index.html', 'htmlcov-coverage-django111-authentic', 'Coverage multipublik tests')
|
||||
utils.publish_coverage_native(
|
||||
'index.html', 'htmlcov-coverage-django111-authentic', 'Coverage multitenant tests')
|
||||
utils.publish_coverage_native(
|
||||
'index.html', 'htmlcov-coverage-django111-authentic', 'Coverage passerelle tests')
|
||||
utils.publish_pylint('pylint.out')
|
||||
}
|
||||
junit 'junit-*.xml'
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Packaging') {
|
||||
steps {
|
||||
script {
|
||||
if (env.JOB_NAME == 'hobo' && env.GIT_BRANCH == 'origin/master') {
|
||||
sh 'sudo -H -u eobuilder /usr/local/bin/eobuilder hobo'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
post {
|
||||
always {
|
||||
script {
|
||||
utils = new Utils()
|
||||
utils.mail_notify(currentBuild, env, 'admin+jenkins-hobo@entrouvert.com')
|
||||
}
|
||||
}
|
||||
success {
|
||||
cleanWs()
|
||||
}
|
||||
}
|
||||
}
|
17
jenkins.sh
17
jenkins.sh
|
@ -4,17 +4,18 @@ set -e # prevent hiding of errors
|
|||
|
||||
rm -f *coverage.xml
|
||||
rm -f *test_results.xml
|
||||
rm -f htmlcov htmlcov-*
|
||||
|
||||
./getlasso.sh
|
||||
pip install --upgrade setuptools
|
||||
pip install --upgrade pip
|
||||
pip install --upgrade pylint pylint-django
|
||||
pip install --upgrade tox
|
||||
virtualenv venv
|
||||
venv/bin/pip install --upgrade setuptools
|
||||
venv/bin/pip install --upgrade pip
|
||||
venv/bin/pip install --upgrade pylint pylint-django
|
||||
venv/bin/pip install --upgrade tox
|
||||
|
||||
tox -r
|
||||
venv/bin/tox -rv
|
||||
|
||||
./merge-junit-results.py junit-*.xml >test_results.xml
|
||||
./merge-coverage.py -o coverage.xml coverage-*.xml
|
||||
# ./merge-junit-results.py junit-*.xml >test_results.xml
|
||||
#./merge-coverage.py -o coverage.xml coverage-*.xml
|
||||
|
||||
|
||||
test -f pylint.out && cp pylint.out pylint.out.prev
|
||||
|
|
3
tox.ini
3
tox.ini
|
@ -24,7 +24,7 @@ setenv =
|
|||
passerelle: DEBIAN_CONFIG_COMMON=debian/debian_config_common.py
|
||||
passerelle: PASSERELLE_SETTINGS_FILE=tests_passerelle/settings.py
|
||||
passerelle: DJANGO_SETTINGS_MODULE=passerelle.settings
|
||||
coverage: COVERAGE=--junitxml=junit-{envname}.xml --cov-report xml --cov=hobo/ --cov-config .coveragerc
|
||||
coverage: COVERAGE=--junitxml=junit-{envname}.xml --cov-report xml --cov-report html --cov=hobo/ --cov-config .coveragerc
|
||||
fast: NOMIGRATIONS=--nomigrations
|
||||
deps:
|
||||
django18: django>=1.8,<1.9
|
||||
|
@ -59,3 +59,4 @@ commands =
|
|||
authentic: py.test {env:FAST:} {env:COVERAGE:} {env:NOMIGRATIONS:} {posargs:tests_authentic/}
|
||||
passerelle: py.test {env:COVERAGE:} {env:NOMIGRATIONS:} {posargs:tests_passerelle/}
|
||||
coverage: mv coverage.xml coverage-{envname}.xml
|
||||
coverage: mv htmlcov htmlcov-{envname}
|
||||
|
|
Loading…
Reference in New Issue