add Jenkinsfile
This commit is contained in:
parent
bf2bd54e89
commit
1d6c32c38b
|
@ -0,0 +1,46 @@
|
|||
@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')
|
||||
utils.publish_pylint('pylint.out')
|
||||
}
|
||||
junit '*_results.xml'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage('Packaging') {
|
||||
steps {
|
||||
script {
|
||||
if (env.JOB_NAME == 'mandayejs' && env.GIT_BRANCH == 'origin/master') {
|
||||
sh 'sudo -H -u eobuilder /usr/local/bin/eobuilder -d stretch mandayejs'
|
||||
} else if (env.GIT_BRANCH.startsWith('hotfix/')) {
|
||||
sh "sudo -H -u eobuilder /usr/local/bin/eobuilder -d stretch --branch ${env.GIT_BRANCH} --hotfix mandayejs"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
post {
|
||||
always {
|
||||
script {
|
||||
utils = new Utils()
|
||||
utils.mail_notify(currentBuild, env, 'admin+jenkins-mandayejs@entrouvert.com')
|
||||
}
|
||||
}
|
||||
success {
|
||||
cleanWs()
|
||||
}
|
||||
}
|
||||
}
|
6
tox.ini
6
tox.ini
|
@ -9,15 +9,15 @@ usedevelop =
|
|||
setenv =
|
||||
DJANGO_SETTINGS_MODULE=mandayejs.settings
|
||||
MANDAYEJS_SETTINGS_FILE=tests/settings.py
|
||||
coverage: COVERAGE=--junitxml=test_results.xml --cov-report xml --cov=mandayejs/ --cov-config .coveragerc
|
||||
coverage: COVERAGE=--junitxml=test_results.xml --cov-report xml --cov-report html --cov=mandayejs/ --cov-config .coveragerc
|
||||
deps =
|
||||
django18: django>=1.8,<1.9
|
||||
django111: django>=1.11,<2.0
|
||||
pytest-cov
|
||||
pytest-django
|
||||
pytest>=3.3.0,<4.1
|
||||
pylint
|
||||
pylint-django
|
||||
pylint<1.8
|
||||
pylint-django<0.8.1
|
||||
mock
|
||||
djangorestframework>=3.3,<3.7
|
||||
commands =
|
||||
|
|
Reference in New Issue