From 3c580f67fea187ac3a62f0f6e20510d256e2133e Mon Sep 17 00:00:00 2001 From: Leo Ryu Date: Sun, 14 May 2023 15:19:58 +0800 Subject: [PATCH] feat(ci): retry upload installer (#2286) --- build/docker/tools/tke-installer/release.sh | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/build/docker/tools/tke-installer/release.sh b/build/docker/tools/tke-installer/release.sh index a066b5efa5..e267b9e218 100755 --- a/build/docker/tools/tke-installer/release.sh +++ b/build/docker/tools/tke-installer/release.sh @@ -125,9 +125,19 @@ function build::installer() { echo "current builder is ${BUILDER}" if [[ "${BUILDER}" == "tke" ]]; then - echo "start upload process" - coscmd upload "${INSTALLER_DIR}/$installer" "$installer" - coscmd upload "$OUTPUT_DIR/$installer.sha256" "$installer.sha256" + echo "start upload" + max_tries=3 + for i in $(seq 1 $max_tries); do + coscmd upload "${INSTALLER_DIR}/$installer" "$installer" && coscmd upload "$OUTPUT_DIR/$installer.sha256" "$installer.sha256" + result=$? + if [[ $result -eq 0 ]]; then + echo "upload successful" + break + else + echo "upload failed" + sleep 1 + fi + done fi }