ci: retry ecr login
This commit is contained in:
@@ -91,11 +91,6 @@ jobs:
|
|||||||
--image-scanning-configuration scanOnPush=true \
|
--image-scanning-configuration scanOnPush=true \
|
||||||
--encryption-configuration encryptionType=AES256 >/dev/null
|
--encryption-configuration encryptionType=AES256 >/dev/null
|
||||||
|
|
||||||
aws ecr get-login-password --region "${AWS_REGION}" \
|
|
||||||
| docker login --username AWS --password-stdin "${ecr_registry}"
|
|
||||||
|
|
||||||
docker tag "${IMAGE_NAME}:prod-${GITHUB_SHA}" "${ecr_image}:latest"
|
|
||||||
|
|
||||||
retry() {
|
retry() {
|
||||||
for attempt in 1 2 3; do
|
for attempt in 1 2 3; do
|
||||||
if "$@"; then
|
if "$@"; then
|
||||||
@@ -107,6 +102,14 @@ jobs:
|
|||||||
sleep "$((attempt * 5))"
|
sleep "$((attempt * 5))"
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ecr_login() {
|
||||||
|
aws ecr get-login-password --region "${AWS_REGION}" \
|
||||||
|
| docker login --username AWS --password-stdin "${ecr_registry}"
|
||||||
|
}
|
||||||
|
|
||||||
|
retry ecr_login
|
||||||
|
docker tag "${IMAGE_NAME}:prod-${GITHUB_SHA}" "${ecr_image}:latest"
|
||||||
retry docker push "${ecr_image}:latest"
|
retry docker push "${ecr_image}:latest"
|
||||||
|
|
||||||
untagged_image_ids="$(aws ecr list-images \
|
untagged_image_ids="$(aws ecr list-images \
|
||||||
|
|||||||
Reference in New Issue
Block a user