From 2c9eb0a342e8e3075ac9ceece09a4c0af61225cb Mon Sep 17 00:00:00 2001 From: Samira Ouaaz Date: Wed, 17 Nov 2021 00:41:51 -0500 Subject: [PATCH] Add Jenkinsfile --- Jenkinsfile | 77 +++++++++++++++++++++++++++++++++-------------------- 1 file changed, 48 insertions(+), 29 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index f4af885..53daea7 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,30 +1,49 @@ pipeline { - agent none - stages { - stage('Build') { - agent { - docker { - image 'python:2-alpine' - } - } - steps { - sh 'python -m py_compile sources/add2vals.py sources/calc.py' - } - } - stage('Test') { //1 - agent { - docker { - image 'qnib/pytest' //2 - } - } - steps { - sh 'py.test --verbose --junit-xml test-reports/results.xml sources/test_calc.py' //3 - } - post { - always { - junit 'test-reports/results.xml' //4 - } - } - } - } -} + agent none + options { + skipStagesAfterUnstable() + } + 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') { //1 + agent { + docker { + image 'cdrx/pyinstaller-linux:python2' //2 + } + } + steps { + sh '/root/.pyenv/shims/pyinstaller --onefile sources/add2vals.py' //3 + } + post { + success { + archiveArtifacts 'dist/add2vals' //4 + } + } + } + } + } +