From 0afde390ac63d132b0ba85440500da3375fd2e22 Mon Sep 17 00:00:00 2001 From: ludamad Date: Sun, 3 Sep 2023 19:06:54 -0400 Subject: [PATCH] fix: add retry_10 around ensure_repo (#1963) This aims to fix a mysterious exit 1 in build. --- build-system/scripts/build | 2 +- build-system/scripts/deploy_dockerhub | 2 +- build-system/scripts/deploy_ecr | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/build-system/scripts/build b/build-system/scripts/build index 4add19d1f1a..2f59649e273 100755 --- a/build-system/scripts/build +++ b/build-system/scripts/build @@ -45,7 +45,7 @@ function fetch_image() { } # Ensure ECR repository exists. -ensure_repo $REPOSITORY $ECR_REGION refresh_lifecycle +retry_10 ensure_repo $REPOSITORY $ECR_REGION refresh_lifecycle CONTENT_HASH=$(calculate_content_hash $REPOSITORY) echo "Content hash: $CONTENT_HASH" diff --git a/build-system/scripts/deploy_dockerhub b/build-system/scripts/deploy_dockerhub index d7e0442d30b..39e3f3c91ab 100755 --- a/build-system/scripts/deploy_dockerhub +++ b/build-system/scripts/deploy_dockerhub @@ -40,7 +40,7 @@ IMAGE_TAG=$COMMIT_TAG_VERSION echo "Deploying to dockerhub: $IMAGE_DEPLOY_URI" # Login. -ensure_repo $REPOSITORY $ECR_DEPLOY_REGION +retry_10 ensure_repo $REPOSITORY $ECR_DEPLOY_REGION # Pull image. docker pull $IMAGE_COMMIT_URI diff --git a/build-system/scripts/deploy_ecr b/build-system/scripts/deploy_ecr index aa512cc1b4b..27343ea48f3 100755 --- a/build-system/scripts/deploy_ecr +++ b/build-system/scripts/deploy_ecr @@ -5,11 +5,11 @@ REPOSITORY=$1 IMAGE_COMMIT_URI=$ECR_URL/$REPOSITORY:cache-$CONTENT_HASH # Login to build region and pull the build. -ensure_repo $REPOSITORY $ECR_REGION +retry_10 ensure_repo $REPOSITORY $ECR_REGION docker pull $IMAGE_COMMIT_URI > /dev/null 2>&1 # Ensure ECR repository exists in deployment region. -ensure_repo $REPOSITORY $ECR_DEPLOY_REGION +retry_10 ensure_repo $REPOSITORY $ECR_DEPLOY_REGION # Push image to deployment repo with commit hash tag e.g: # falafel:deadbeefcafebabe1337c0de