From 2340547dd3f7a31ac415b8c6e060490bd5855f5c Mon Sep 17 00:00:00 2001 From: xiaojias <649788479@qq.com> Date: Wed, 6 Mar 2019 11:56:51 +0800 Subject: [PATCH] Add final deliver stage --- Jenkinsfile | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 1fb8ae6..e2ead5b 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -11,18 +11,33 @@ pipeline { sh 'python -m py_compile sources/add2vals.py sources/calc.py' } } - stage('Test') { + stage('Test') { agent { docker { - image 'richardx/pytest' + image 'richardx/pytest' } } steps { - sh 'py.test --verbose --junit-xml test-reports/results.xml sources/test_calc.py' + sh 'py.test --verbose --junit-xml test-reports/results.xml sources/test_calc.py' } post { always { - junit 'test-reports/results.xml' + junit 'test-reports/results.xml' + } + } + } + stage('Deliver') { + agent { + docker { + image 'richardx/pyinstaller-linux:python2' + } + } + steps { + sh 'pyinstaller --onefile sources/add2vals.py' + } + post { + success { + archiveArtifacts 'dist/add2vals' } } }