Skip to content

Commit

Permalink
ci: Deploy to pypi uses generic python docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
henryborchers committed Nov 19, 2024
1 parent c0cd916 commit 31d6364
Showing 1 changed file with 46 additions and 9 deletions.
55 changes: 46 additions & 9 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -1364,11 +1364,18 @@ pipeline {
stage('Deploy'){
parallel {
stage('Deploy to pypi') {
environment{
PIP_CACHE_DIR='/tmp/pipcache'
UV_INDEX_STRATEGY='unsafe-best-match'
UV_TOOL_DIR='/tmp/uvtools'
UV_PYTHON_INSTALL_DIR='/tmp/uvpython'
UV_CACHE_DIR='/tmp/uvcache'
}
agent {
dockerfile {
filename 'ci/docker/linux/jenkins/Dockerfile'
label 'linux && docker && x86'
additionalBuildArgs '--build-arg PIP_EXTRA_INDEX_URL'
docker{
image 'python'
label 'docker && linux'
args '--mount source=python-tmp-py3exiv2bind,target=/tmp'
}
}
when{
Expand Down Expand Up @@ -1398,12 +1405,42 @@ pipeline {
wheelStashes.each{
unstash it
}
withEnv(
[
"TWINE_REPOSITORY_URL=${SERVER_URL}",
'UV_INDEX_STRATEGY=unsafe-best-match'
]
){
withCredentials(
[
usernamePassword(
credentialsId: 'jenkins-nexus',
passwordVariable: 'TWINE_PASSWORD',
usernameVariable: 'TWINE_USERNAME'
)
]){
sh(
label: 'Uploading to pypi',
script: '''python3 -m venv venv
trap "rm -rf venv" EXIT
. ./venv/bin/activate
pip install --disable-pip-version-check uv
uvx --with-requirements=requirements-dev.txt twine upload --disable-progress-bar --non-interactive dist/*
'''
)
}
}
}
}
post{
cleanup{
cleanWs(
deleteDirs: true,
patterns: [
[pattern: 'dist/', type: 'INCLUDE']
]
)
}
pypiUpload(
credentialsId: 'jenkins-nexus',
repositoryUrl: SERVER_URL,
glob: 'dist/*'
)
}
}
stage('Deploy Online Documentation') {
Expand Down

0 comments on commit 31d6364

Please sign in to comment.