Skip to content

Commit 43a8753

Browse files
committed
ci: gathering linux tox stages will retry on failure
1 parent 6544f61 commit 43a8753

File tree

1 file changed

+25
-16
lines changed

1 file changed

+25
-16
lines changed

vars/runJenkinsPipeline.groovy

Lines changed: 25 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -225,24 +225,33 @@ def call(){
225225
steps{
226226
script{
227227
def envs = []
228-
node('docker && linux'){
229-
docker.image('python').inside('--mount source=python-tmp-packageValidation,target=/tmp'){
228+
retry(2){
229+
node('docker && linux'){
230230
try{
231231
checkout scm
232-
sh(script: 'python3 -m venv venv && venv/bin/pip install --disable-pip-version-check uv')
233-
envs = sh(
234-
label: 'Get tox environments',
235-
script: './venv/bin/uv run --only-group tox --with tox-uv --isolated --quiet tox list -d --no-desc',
236-
returnStdout: true,
237-
).trim().split('\n')
238-
} finally{
239-
cleanWs(
240-
patterns: [
241-
[pattern: 'venv/', type: 'INCLUDE'],
242-
[pattern: '.tox', type: 'INCLUDE'],
243-
[pattern: '**/__pycache__/', type: 'INCLUDE'],
244-
]
245-
)
232+
docker.image('python').inside('--mount source=python-tmp-packageValidation,target=/tmp'){
233+
retry(2){
234+
try{
235+
sh(script: 'python3 -m venv venv && venv/bin/pip install --disable-pip-version-check uv')
236+
envs = sh(
237+
label: 'Get tox environments',
238+
script: './venv/bin/uv run --only-group tox --with tox-uv --isolated --quiet tox list -d --no-desc',
239+
returnStdout: true,
240+
).trim().split('\n')
241+
} catch (e){
242+
cleanWs(
243+
patterns: [
244+
[pattern: 'venv/', type: 'INCLUDE'],
245+
[pattern: '.tox', type: 'INCLUDE'],
246+
[pattern: '**/__pycache__/', type: 'INCLUDE'],
247+
]
248+
)
249+
throw e
250+
}
251+
}
252+
} finally {
253+
sh "${tool(name: 'Default', type: 'git')} clean -dfx"
254+
}
246255
}
247256
}
248257
}

0 commit comments

Comments
 (0)