From 0b28c94762b5516598e0aaf5e6d7920239df14fc Mon Sep 17 00:00:00 2001 From: kurihada Date: Tue, 3 Mar 2026 15:30:16 +0800 Subject: [PATCH] =?UTF-8?q?Jenkins=20=E9=95=9C=E5=83=8F=E9=A2=84=E6=8B=89?= =?UTF-8?q?=E5=8F=96=E5=A2=9E=E5=8A=A0=E8=B6=85=E6=97=B6=E9=87=8D=E8=AF=95?= =?UTF-8?q?=E4=B8=8E=E7=BC=93=E5=AD=98=E6=A3=80=E6=B5=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Jenkinsfile | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 73d1b6d..8776310 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -23,11 +23,27 @@ pipeline { } stage('Prepare Test Images') { + options { + timeout(time: 15, unit: 'MINUTES') + } steps { - sh ''' - docker pull node:20-bookworm - docker pull mcr.microsoft.com/playwright:v1.51.1-jammy - ''' + retry(2) { + 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 + 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 + ''' + } } }