From 50793f1a8a7e3b7159449cf8dbea90f243100896 Mon Sep 17 00:00:00 2001 From: blue-bubbaloo Date: Mon, 25 Aug 2025 14:00:04 -0300 Subject: [PATCH 1/6] Update add2vals.py --- sources/add2vals.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sources/add2vals.py b/sources/add2vals.py index d671e38ea..19da48349 100644 --- a/sources/add2vals.py +++ b/sources/add2vals.py @@ -1,6 +1,9 @@ ''' A simple command line tool that takes 2 values and adds them together using the calc.py library's 'add2' function. + + +Mudanças feita por Marbel ''' import sys From a691037678fc939bb629662b06f16ac33b4846aa Mon Sep 17 00:00:00 2001 From: blue-bubbaloo Date: Mon, 25 Aug 2025 14:37:59 -0300 Subject: [PATCH 2/6] Create Jenkinsfile --- Jenkinsfile | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 Jenkinsfile diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 000000000..bab66afc6 --- /dev/null +++ b/Jenkinsfile @@ -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*') + } + } + } +} \ No newline at end of file From b058f97da4509cf638e2900f15bb1ff750cb9e50 Mon Sep 17 00:00:00 2001 From: blue-bubbaloo Date: Mon, 25 Aug 2025 15:07:38 -0300 Subject: [PATCH 3/6] Update Jenkinsfile --- Jenkinsfile | 44 +++++++++++++++++++++++++++++++++++++++----- 1 file changed, 39 insertions(+), 5 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index bab66afc6..93796b628 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,11 +1,45 @@ pipeline { - agent any + agent none stages { - stage('Build') { + 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 'python -m py_compile sources/add2vals.py sources/calc.py' - stash(name: 'compiled-results', includes: 'sources/*.py*') + 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' + } } } } -} \ No newline at end of file +} From 38727d6a693e321ce1c4456ce6d75fa8cf7ea16c Mon Sep 17 00:00:00 2001 From: blue-bubbaloo Date: Mon, 25 Aug 2025 15:13:34 -0300 Subject: [PATCH 4/6] Update Jenkinsfile --- Jenkinsfile | 42 ++++-------------------------------------- 1 file changed, 4 insertions(+), 38 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 93796b628..d6ee49d13 100644 --- a/Jenkinsfile +++ b/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' - } - } + stage('Build') { 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' - } + sh 'python -m py_compile sources/add2vals.py sources/calc.py' + stash(name: 'compiled-results', includes: 'sources/*.py*') } } } From c869e9010aa8e64c5a2b951c72ba7a6fc5e82985 Mon Sep 17 00:00:00 2001 From: blue-bubbaloo Date: Mon, 25 Aug 2025 15:28:23 -0300 Subject: [PATCH 5/6] Update Jenkinsfile adicionando estagio de teste --- Jenkinsfile | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index d6ee49d13..629fe9263 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -7,5 +7,15 @@ pipeline { stash(name: 'compiled-results', includes: 'sources/*.py*') } } + stage('Test') { + steps { + sh 'py.test --junit-xml test-reports/results.xml sources/test_calc.py' + } + post { + always { + junit 'test-reports/results.xml' + } + } + } } } From 3eab71f67f68f9027cb7cdd0458ba5b05978bdc2 Mon Sep 17 00:00:00 2001 From: blue-bubbaloo Date: Mon, 25 Aug 2025 15:38:44 -0300 Subject: [PATCH 6/6] Update Jenkinsfile Add Delivery stage --- Jenkinsfile | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index 629fe9263..570d77f74 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -17,5 +17,15 @@ pipeline { } } } + stage('Deliver') { + steps { + sh "pyinstaller --onefile sources/add2vals.py" + } + post { + success { + archiveArtifacts 'dist/add2vals' + } + } + } } }