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:
Jake Bauer 2023-11-27 18:12:46 +01:00
parent dff281a84c
commit a47cb77e03
1 changed files with 39 additions and 0 deletions

39
Jenkinsfile vendored Normal file
View File

@ -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'"
}
}
}
}
}