Jenkins 镜像预拉取增加超时重试与缓存检测
This commit is contained in:
Vendored
+20
-4
@@ -23,11 +23,27 @@ pipeline {
|
|||||||
}
|
}
|
||||||
|
|
||||||
stage('Prepare Test Images') {
|
stage('Prepare Test Images') {
|
||||||
|
options {
|
||||||
|
timeout(time: 15, unit: 'MINUTES')
|
||||||
|
}
|
||||||
steps {
|
steps {
|
||||||
sh '''
|
retry(2) {
|
||||||
docker pull node:20-bookworm
|
sh '''
|
||||||
docker pull mcr.microsoft.com/playwright:v1.51.1-jammy
|
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
|
||||||
|
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
|
||||||
|
fi
|
||||||
|
'''
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user