From 2de37da11a17b6b5569ef4477cb64eab8c8484bb Mon Sep 17 00:00:00 2001 From: Wildey13 <2405772@student.uwtsd.ac.uk> Date: Tue, 18 Nov 2025 17:14:40 +0000 Subject: [PATCH 1/3] add build stage --- jenkins/Jenkinsfile.txt | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 jenkins/Jenkinsfile.txt diff --git a/jenkins/Jenkinsfile.txt b/jenkins/Jenkinsfile.txt new file mode 100644 index 000000000..f3f838b86 --- /dev/null +++ b/jenkins/Jenkinsfile.txt @@ -0,0 +1,11 @@ +pipeline { + agent any + stages { + stage('Build') { + steps { + sh 'python -m py_compile sources/add2vals.py sources/calc.py' + stash(name: 'compiled-results', includes: 'sources/*.py*') + } + } + } +} From 984b4873da1b049736e91e0df757a6cb48a86a56 Mon Sep 17 00:00:00 2001 From: Wildey13 <2405772@student.uwtsd.ac.uk> Date: Tue, 18 Nov 2025 17:29:01 +0000 Subject: [PATCH 2/3] Jenkinsfile New build stage --- jenkins/Jenkinsfile | 38 ++------------------------------------ 1 file changed, 2 insertions(+), 36 deletions(-) diff --git a/jenkins/Jenkinsfile b/jenkins/Jenkinsfile index 93796b628..f3f838b86 100644 --- a/jenkins/Jenkinsfile +++ b/jenkins/Jenkinsfile @@ -1,44 +1,10 @@ pipeline { - agent none + agent any stages { stage('Build') { - agent { - docker { - image 'python:2-alpine' - } - } steps { sh 'python -m py_compile sources/add2vals.py sources/calc.py' - } - } - stage('Test') { - agent { - docker { - image 'qnib/pytest' - } - } - steps { - sh 'py.test --verbose --junit-xml test-reports/results.xml sources/test_calc.py' - } - post { - always { - junit 'test-reports/results.xml' - } - } - } - stage('Deliver') { - agent { - docker { - image 'cdrx/pyinstaller-linux:python2' - } - } - steps { - sh 'pyinstaller --onefile sources/add2vals.py' - } - post { - success { - archiveArtifacts 'dist/add2vals' - } + stash(name: 'compiled-results', includes: 'sources/*.py*') } } } From a283e2e201522c4298628244e5000139c1588bbf Mon Sep 17 00:00:00 2001 From: Wildey13 <2405772@student.uwtsd.ac.uk> Date: Tue, 18 Nov 2025 17:35:36 +0000 Subject: [PATCH 3/3] Update Jenkinsfile --- jenkins/Jenkinsfile | 38 ++++++++++++++++++++++++++++++++++++-- 1 file changed, 36 insertions(+), 2 deletions(-) diff --git a/jenkins/Jenkinsfile b/jenkins/Jenkinsfile index f3f838b86..93796b628 100644 --- a/jenkins/Jenkinsfile +++ b/jenkins/Jenkinsfile @@ -1,10 +1,44 @@ pipeline { - agent any + agent none stages { stage('Build') { + agent { + docker { + image 'python:2-alpine' + } + } steps { sh 'python -m py_compile sources/add2vals.py sources/calc.py' - stash(name: 'compiled-results', includes: 'sources/*.py*') + } + } + stage('Test') { + agent { + docker { + image 'qnib/pytest' + } + } + steps { + sh 'py.test --verbose --junit-xml test-reports/results.xml sources/test_calc.py' + } + post { + always { + junit 'test-reports/results.xml' + } + } + } + stage('Deliver') { + agent { + docker { + image 'cdrx/pyinstaller-linux:python2' + } + } + steps { + sh 'pyinstaller --onefile sources/add2vals.py' + } + post { + success { + archiveArtifacts 'dist/add2vals' + } } } }