File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ if [ -n "$ALLOW_MISSING" ] && [ "$ALLOW_MISSING" != '--allow-missing' ]; then
99 exit 1
1010fi
1111export AWS_PAGER=' '
12- aws ecr batch-get-image --repository-name " $REPOSITORY " --image-ids imageTag=" $TAG " --output json |
12+ aws --cli-connect-timeout 10 --cli-read-timeout 20 ecr batch-get-image --repository-name " $REPOSITORY " --image-ids imageTag=" $TAG " --output json |
1313 ALLOW_MISSING=" $ALLOW_MISSING " python3 -c '
1414import json, os, re, sys
1515response = json.load(sys.stdin)
Original file line number Diff line number Diff line change @@ -17,10 +17,10 @@ MANIFEST=$(docker buildx imagetools create --dry-run -t "$REGISTRY/$REPOSITORY:$
1717DIGEST=" sha256:$( printf ' %s' " $MANIFEST " | sha256sum | cut -d' ' -f1) "
1818EPOCH=$( date +%s)
1919bash " $SCRIPT_DIR /promote-image.sh" " $REGISTRY " " $REPOSITORY " " $SOURCE_TAG " " $DEPLOY_TAG " " $RELEASE_TAG "
20- for attempt in $( seq 1 20 ) ; do
21- [ " $( bash " $SCRIPT_DIR /get-ecr-image-digest.sh" " $REPOSITORY " " $DEPLOY_TAG " --allow-missing) " = " $DIGEST " ] && break
22- if [ " $attempt " -eq 20 ]; then
23- echo " ERROR: $DEPLOY_TAG never resolved to the pushed $DIGEST ; cutover cannot be correlated" >&2
20+ deadline= $(( $(date +% s) + 60 ))
21+ until [ " $( bash " $SCRIPT_DIR /get-ecr-image-digest.sh" " $REPOSITORY " " $DEPLOY_TAG " --allow-missing) " = " $DIGEST " ]; do
22+ if [ " $( date +%s ) " -ge " $deadline " ]; then
23+ echo " ERROR: $DEPLOY_TAG did not resolve to the pushed $DIGEST within 60s ; cutover cannot be correlated" >&2
2424 exit 1
2525 fi
2626 sleep 3
You can’t perform that action at this time.
0 commit comments