Jenkins 镜像预拉取增加超时重试与缓存检测

This commit is contained in:
2026-03-03 15:30:16 +08:00
parent 35aa7fb6bc
commit 0b28c94762
Vendored
+16
View File
@@ -23,13 +23,29 @@ pipeline {
} }
stage('Prepare Test Images') { stage('Prepare Test Images') {
options {
timeout(time: 15, unit: 'MINUTES')
}
steps { steps {
retry(2) {
sh ''' sh '''
set -e
if docker image inspect node:20-bookworm >/dev/null 2>&1; then
echo "node:20-bookworm already exists, skip pull"
else
docker pull node:20-bookworm docker pull node:20-bookworm
fi
if docker image inspect mcr.microsoft.com/playwright:v1.51.1-jammy >/dev/null 2>&1; then
echo "mcr.microsoft.com/playwright:v1.51.1-jammy already exists, skip pull"
else
docker pull mcr.microsoft.com/playwright:v1.51.1-jammy docker pull mcr.microsoft.com/playwright:v1.51.1-jammy
fi
''' '''
} }
} }
}
stage('Quality Gate') { stage('Quality Gate') {
steps { steps {