Leave Jenkinsfile only in Jenkins folder
This commit is contained in:
parent
0455829d1d
commit
1be87017c0
2 changed files with 17 additions and 62 deletions
53
Jenkinsfile
vendored
53
Jenkinsfile
vendored
|
@ -1,53 +0,0 @@
|
||||||
pipeline {
|
|
||||||
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'
|
|
||||||
stash(name: 'compiled-results', includes: 'sources/*.py*')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
stage('Test') {
|
|
||||||
agent {
|
|
||||||
docker {
|
|
||||||
image 'qnib/pytest'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
steps {
|
|
||||||
sh 'py.test --junit-xml test-reports/results.xml sources/test_calc.py'
|
|
||||||
}
|
|
||||||
post {
|
|
||||||
always {
|
|
||||||
junit 'test-reports/results.xml'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
stage('Deliver') {
|
|
||||||
agent any
|
|
||||||
environment {
|
|
||||||
VOLUME = '$(pwd)/sources:/src'
|
|
||||||
IMAGE = 'cdrx/pyinstaller-linux:python2'
|
|
||||||
}
|
|
||||||
steps {
|
|
||||||
dir(path: env.BUILD_ID) {
|
|
||||||
unstash(name: 'compiled-results')
|
|
||||||
sh "docker run --rm -v ${VOLUME} ${IMAGE} 'pyinstaller -F add2vals.py'"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
post {
|
|
||||||
success {
|
|
||||||
archiveArtifacts "${env.BUILD_ID}/sources/dist/add2vals"
|
|
||||||
sh "docker run --rm -v ${VOLUME} ${IMAGE} 'rm -rf build dist'"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
26
jenkins/Jenkinsfile
vendored
26
jenkins/Jenkinsfile
vendored
|
@ -1,5 +1,8 @@
|
||||||
pipeline {
|
pipeline {
|
||||||
agent none
|
agent none
|
||||||
|
options {
|
||||||
|
skipStagesAfterUnstable()
|
||||||
|
}
|
||||||
stages {
|
stages {
|
||||||
stage('Build') {
|
stage('Build') {
|
||||||
agent {
|
agent {
|
||||||
|
@ -9,6 +12,7 @@ pipeline {
|
||||||
}
|
}
|
||||||
steps {
|
steps {
|
||||||
sh 'python -m py_compile sources/add2vals.py sources/calc.py'
|
sh 'python -m py_compile sources/add2vals.py sources/calc.py'
|
||||||
|
stash(name: 'compiled-results', includes: 'sources/*.py*')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage('Test') {
|
stage('Test') {
|
||||||
|
@ -18,7 +22,7 @@ pipeline {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
steps {
|
steps {
|
||||||
sh 'py.test --verbose --junit-xml test-reports/results.xml sources/test_calc.py'
|
sh 'py.test --junit-xml test-reports/results.xml sources/test_calc.py'
|
||||||
}
|
}
|
||||||
post {
|
post {
|
||||||
always {
|
always {
|
||||||
|
@ -26,20 +30,24 @@ pipeline {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage('Deliver') {
|
stage('Deliver') {
|
||||||
agent {
|
agent any
|
||||||
docker {
|
environment {
|
||||||
image 'cdrx/pyinstaller-linux:python2'
|
VOLUME = '$(pwd)/sources:/src'
|
||||||
}
|
IMAGE = 'cdrx/pyinstaller-linux:python2'
|
||||||
}
|
}
|
||||||
steps {
|
steps {
|
||||||
sh 'pyinstaller --onefile sources/add2vals.py'
|
dir(path: env.BUILD_ID) {
|
||||||
|
unstash(name: 'compiled-results')
|
||||||
|
sh "docker run --rm -v ${VOLUME} ${IMAGE} 'pyinstaller -F add2vals.py'"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
post {
|
post {
|
||||||
success {
|
success {
|
||||||
archiveArtifacts 'dist/add2vals'
|
archiveArtifacts "${env.BUILD_ID}/sources/dist/add2vals"
|
||||||
|
sh "docker run --rm -v ${VOLUME} ${IMAGE} 'rm -rf build dist'"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in a new issue