fenen/Jenkinsfile

39 lines
1.1 KiB
Groovy

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*, fenen.spec, requirements.txt')
}
}
stage('Deliver') {
agent any
environment {
VOLUME = '$(pwd)/:/src'
IMAGE = 'cdrx/pyinstaller-linux:latest'
}
steps {
dir(path: env.BUILD_ID) {
unstash(name: 'compiled-results')
sh "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'"
}
}
}
}
}