From 706b03f84edbba647256528553c7985006074439 Mon Sep 17 00:00:00 2001 From: xiangning Date: Fri, 17 Jul 2026 14:16:27 +0800 Subject: [PATCH] =?UTF-8?q?fix(cicd):=20docker=20push=20=E5=8A=A0=E9=87=8D?= =?UTF-8?q?=E8=AF=95=E5=BE=AA=E7=8E=AF=EF=BC=888=E6=AC=A1=EF=BC=89?= =?UTF-8?q?=EF=BC=8C=E5=BA=94=E5=AF=B9=E8=B7=A8=E5=9C=B0=E5=9F=9F=E7=BD=91?= =?UTF-8?q?=E7=BB=9C=E6=96=AD=E6=B5=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 与 api 同款修复:push 大 blob 断流时重试,断点续传。 --- Jenkinsfile | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 83cfb3e..9f015c5 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -35,8 +35,17 @@ pipeline { withCredentials([usernamePassword(credentialsId: "harbor-credentials", usernameVariable: "HUSER", passwordVariable: "HPASS")]) { sh ''' echo $HPASS | docker login $HARBOR -u $HUSER --password-stdin - docker push $IMAGE:$TAG - docker push $IMAGE:latest + # 跨地域 push 大 blob 易断流,重试利用断点续传 + for i in 1 2 3 4 5 6 7 8; do + docker push $IMAGE:$TAG && break + echo "push $IMAGE:$TAG 第 $i 次中断,3秒后重试(断点续传)..." + sleep 3 + done + for i in 1 2 3 4 5 6 7 8; do + docker push $IMAGE:latest && break + echo "push $IMAGE:latest 第 $i 次中断,3秒后重试..." + sleep 3 + done docker logout $HARBOR ''' }