Skip to content

Commit 22350c1

Browse files
committed
feat(jenkins): modernize pipeline for Python 3 and quickstart-tutorials
- Replace Docker-based agents with 'agent any' for compatibility with jenkins-docs/quickstart-tutorials environment - Update Build stage to use python3 instead of python - Add skipStagesAfterUnstable option - Add stash for compiled results - Remove deprecated Docker images (python:2-alpine, qnib/pytest, cdrx/pyinstaller-linux:python2) This change aligns the reference Jenkinsfile with the quickstart-tutorials infrastructure which provides a Python agent with Python 3, pytest, and pyinstaller pre-installed. Fixes #85
1 parent 128e9ba commit 22350c1

1 file changed

Lines changed: 6 additions & 17 deletions

File tree

jenkins/Jenkinsfile

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,16 @@
11
pipeline {
2-
agent none
2+
agent any
3+
options {
4+
skipStagesAfterUnstable()
5+
}
36
stages {
47
stage('Build') {
5-
agent {
6-
docker {
7-
image 'python:2-alpine'
8-
}
9-
}
108
steps {
11-
sh 'python -m py_compile sources/add2vals.py sources/calc.py'
9+
sh 'python3 -m py_compile sources/add2vals.py sources/calc.py'
10+
stash(name: 'compiled-results', includes: 'sources/*.py*')
1211
}
1312
}
1413
stage('Test') {
15-
agent {
16-
docker {
17-
image 'qnib/pytest'
18-
}
19-
}
2014
steps {
2115
sh 'py.test --verbose --junit-xml test-reports/results.xml sources/test_calc.py'
2216
}
@@ -27,11 +21,6 @@ pipeline {
2721
}
2822
}
2923
stage('Deliver') {
30-
agent {
31-
docker {
32-
image 'cdrx/pyinstaller-linux:python2'
33-
}
34-
}
3524
steps {
3625
sh 'pyinstaller --onefile sources/add2vals.py'
3726
}

0 commit comments

Comments
 (0)