Skip to content

Commit 707cc70

Browse files
committed
Update Jenkinsfile
* This time, switch back to Python 2, use "pytest" to generate JUnit XML report that gets exposed through Jenkins, then archive the Linux executable.
1 parent f4d0302 commit 707cc70

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

jenkins/Jenkinsfile

+15-5
Original file line numberDiff line numberDiff line change
@@ -4,32 +4,42 @@ pipeline {
44
stage('Build') {
55
agent {
66
docker {
7-
image 'python:3.4-slim'
7+
image 'python:2-alpine'
88
}
99
}
1010
steps {
11-
sh 'python -m py_compile sources/add2vals.py'
11+
sh 'python -m py_compile sources/add2vals.py sources/calc.py'
1212
}
1313
}
1414
stage('Test') {
1515
agent {
1616
docker {
17-
image 'python:3.4-slim'
17+
image 'qnib/pytest'
1818
}
1919
}
2020
steps {
21-
sh 'python sources/test_calc.py'
21+
sh 'py.test --verbose --junit-xml test-reports/results.xml sources/test_calc.py'
22+
}
23+
post {
24+
always {
25+
junit 'test-reports/results.xml'
26+
}
2227
}
2328
}
2429
stage('Deliver') {
2530
agent {
2631
docker {
27-
image 'cdrx/pyinstaller-linux'
32+
image 'cdrx/pyinstaller-linux:python2'
2833
}
2934
}
3035
steps {
3136
sh 'pyinstaller --onefile sources/add2vals.py'
3237
}
38+
post {
39+
success {
40+
archiveArtifacts 'dist/add2vals'
41+
}
42+
}
3343
}
3444
}
3545
}

0 commit comments

Comments
 (0)