Skip to content

Commit c32edf1

Browse files
committed
ci: cleanup tox environment between retries
1 parent e71751c commit c32edf1

1 file changed

Lines changed: 17 additions & 7 deletions

File tree

vars/runJenkinsPipeline.groovy

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -596,19 +596,29 @@ def call(){
596596
{
597597
node('docker && windows'){
598598
try{
599+
checkout scm
599600
docker.image(env.DEFAULT_PYTHON_DOCKER_IMAGE ? env.DEFAULT_PYTHON_DOCKER_IMAGE: 'python').inside(
600601
"--mount type=volume,source=uv_python_install_dir,target=${env.UV_PYTHON_INSTALL_DIR}"
601602
+ " --mount type=volume,source=pipcache,target=${env.PIP_CACHE_DIR}"
602603
+ " --mount type=volume,source=uv_cache_dir,target=${env.UV_CACHE_DIR}"
603604
){
604-
checkout scm
605605
retry(3){
606-
bat(label: 'Running Tox',
607-
script: """python -m venv venv && venv\\Scripts\\pip install --disable-pip-version-check uv
608-
venv\\Scripts\\uv python install cpython-${version}
609-
venv\\Scripts\\uvx -p ${version} --with tox-uv tox run -e ${toxEnv}
610-
"""
611-
)
606+
try{
607+
bat(label: 'Running Tox',
608+
script: """python -m venv venv && venv\\Scripts\\pip install --disable-pip-version-check uv
609+
venv\\Scripts\\uv python install cpython-${version}
610+
venv\\Scripts\\uvx -p ${version} --with tox-uv tox run -e ${toxEnv}
611+
"""
612+
)
613+
} catch(e) {
614+
cleanWs(
615+
patterns: [
616+
[pattern: 'venv', type: 'INCLUDE'],
617+
[pattern: '.tox', type: 'INCLUDE'],
618+
]
619+
)
620+
throw e
621+
}
612622
}
613623
}
614624
} finally{

0 commit comments

Comments
 (0)