Check in Jenkinsfile
It's much nicer to be able to edit it as part of the project instead of needing to use the web interface.
This commit is contained in:
parent
dff281a84c
commit
a47cb77e03
|
@ -0,0 +1,39 @@
|
|||
pipeline {
|
||||
agent none
|
||||
options {
|
||||
skipStagesAfterUnstable()
|
||||
}
|
||||
stages {
|
||||
stage('Build') {
|
||||
agent {
|
||||
docker {
|
||||
image 'python:3.12.0-alpine3.18'
|
||||
}
|
||||
}
|
||||
steps {
|
||||
sh 'python -m py_compile *.py'
|
||||
stash(name: 'compiled-results', includes: '*.py*')
|
||||
}
|
||||
}
|
||||
stage('Deliver') {
|
||||
agent any
|
||||
environment {
|
||||
VOLUME = '$(pwd)/:/src'
|
||||
IMAGE = 'cdrx/pyinstaller-linux:latest'
|
||||
}
|
||||
steps {
|
||||
dir(path: env.BUILD_ID) {
|
||||
unstash(name: 'compiled-results')
|
||||
sh label: "Install Dependencies", script: "pip install feedparser"
|
||||
sh label: "Invoke PyInstaller", script: "docker run --rm -v ${VOLUME} ${IMAGE} 'pyinstaller --onefile fenen.py'"
|
||||
}
|
||||
}
|
||||
post {
|
||||
success {
|
||||
archiveArtifacts "${env.BUILD_ID}/dist/fenen"
|
||||
sh "docker run --rm -v ${VOLUME} ${IMAGE} 'rm -rf build dist'"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue