Compare commits

...

14 Commits

3 changed files with 27 additions and 9 deletions

29
Jenkinsfile vendored
View File

@ -3,13 +3,23 @@
pipeline {
agent any
stages{
stage('unit test'){
steps{
sh 'tox -r -- --junitxml=test_results.xml --cov-report xml --cov=bidon/ tests/'
stage('Unit tests') {
parallel {
stage('Python 2') {
steps {
sh 'tox -r -e py2-django111 -- --junitxml=test_results.xml --cov-report xml --cov-report html --cov=bidon/ tests/'
}
}
stage('Python 3') {
agent any
steps {
sh 'tox -r -e py3-django111 -- tests/'
}
}
}
}
stage('packaging'){
steps{
stage('Packaging') {
steps {
script {
if (env.BRANCH_NAME == 'master') {
sh 'sudo -H -u eobuilder /usr/local/bin/eobuilder -d jessie bidon'
@ -21,6 +31,15 @@ pipeline {
post {
always {
junit 'test_results.xml'
publishHTML target : [
allowMissing: false,
alwaysLinkToLastBuild: false,
keepAll: true,
reportDir: 'htmlcov',
reportFiles: 'index.html',
reportName: 'Coverage Report (native)',
reportTitles: ''
]
script {
utils = new Utils()
utils.publish_cobertura_report('**/coverage.xml')

View File

@ -1,4 +1,4 @@
#! /usr/bin/env python
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
import os
@ -34,7 +34,7 @@ def get_version():
p = subprocess.Popen(['git', 'describe', '--dirty', '--match=v*'], stdout=subprocess.PIPE)
result = p.communicate()[0]
if p.returncode == 0:
version = result.split()[0][1:]
version = str(result.split()[0][1:])
version = version.replace('-', '.')
return version
return '0'

View File

@ -1,12 +1,11 @@
[tox]
envlist = django18,django111
envlist = {py2,py3}-django111
[testenv]
usedevelop = True
setenv =
DJANGO_SETTINGS_MODULE=bidon.settings
deps =
django18: django>=1.8,<1.9
django111: django>=1.11,<1.12
pytest-cov
pytest-django