Add Jenkinsfile

This commit is contained in:
Samira Ouaaz 2021-11-17 00:41:51 -05:00
parent 061820190c
commit 2c9eb0a342

77
Jenkinsfile vendored
View file

@ -1,30 +1,49 @@
pipeline { pipeline {
agent none agent none
stages { options {
stage('Build') { skipStagesAfterUnstable()
agent { }
docker { stages {
image 'python:2-alpine' stage('Build') {
} agent {
} docker {
steps { image 'python:2-alpine'
sh 'python -m py_compile sources/add2vals.py sources/calc.py' }
} }
} steps {
stage('Test') { //1 sh 'python -m py_compile sources/add2vals.py sources/calc.py'
agent { }
docker { }
image 'qnib/pytest' //2 stage('Test') {
} agent {
} docker {
steps { image 'qnib/pytest'
sh 'py.test --verbose --junit-xml test-reports/results.xml sources/test_calc.py' //3 }
} }
post { steps {
always { sh 'py.test --verbose --junit-xml test-reports/results.xml sources/test_calc.py'
junit 'test-reports/results.xml' //4 }
} 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
}
}
}
}
}