forked from nyu-devops/lab-flask-bdd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
27 lines (26 loc) · 794 Bytes
/
Jenkinsfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!groovy
node {
stage ('Clone') {
gotClone=true
timeout(time: 60, unit: 'SECONDS') {
deleteDir()
checkout scm // checks out the git repo that contains this Jenkinsfile
}
}
stage ('Test') {
sh '''
if [ ! -d "venv" ]; then
virtualenv venv
fi
. venv/bin/activate
pip install -q -r requirements.txt
if [ ! -d "reports" ]; then
mkdir reports
fi
nosetests --with-xunit --xunit-file=./reports/unittests.xml
'''
step([$class: 'XUnitBuilder',
thresholds: [[$class: 'FailedThreshold', unstableThreshold: '1']],
tools: [[$class: 'JUnitType', pattern: 'reports/unittests.xml']]])
}
}