Add Jenkinsfile
This commit is contained in:
parent
061820190c
commit
2c9eb0a342
1 changed files with 48 additions and 29 deletions
27
Jenkinsfile
vendored
27
Jenkinsfile
vendored
|
@ -1,5 +1,8 @@
|
||||||
pipeline {
|
pipeline {
|
||||||
agent none
|
agent none
|
||||||
|
options {
|
||||||
|
skipStagesAfterUnstable()
|
||||||
|
}
|
||||||
stages {
|
stages {
|
||||||
stage('Build') {
|
stage('Build') {
|
||||||
agent {
|
agent {
|
||||||
|
@ -11,20 +14,36 @@ pipeline {
|
||||||
sh 'python -m py_compile sources/add2vals.py sources/calc.py'
|
sh 'python -m py_compile sources/add2vals.py sources/calc.py'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage('Test') { //1
|
stage('Test') {
|
||||||
agent {
|
agent {
|
||||||
docker {
|
docker {
|
||||||
image 'qnib/pytest' //2
|
image 'qnib/pytest'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
steps {
|
steps {
|
||||||
sh 'py.test --verbose --junit-xml test-reports/results.xml sources/test_calc.py' //3
|
sh 'py.test --verbose --junit-xml test-reports/results.xml sources/test_calc.py'
|
||||||
}
|
}
|
||||||
post {
|
post {
|
||||||
always {
|
always {
|
||||||
junit 'test-reports/results.xml' //4
|
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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue