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 + ''' + } } }