Compare commits
2 Commits
0a9c026b1b
..
dev
| Author | SHA1 | Date | |
|---|---|---|---|
| 9d17c7d8cc | |||
| 5895b93b12 |
@@ -73,6 +73,8 @@ jobs:
|
|||||||
ECR_REPOSITORY: ${{ secrets.ECR_REPOSITORY }}
|
ECR_REPOSITORY: ${{ secrets.ECR_REPOSITORY }}
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
export HTTP_PROXY= HTTPS_PROXY= ALL_PROXY= http_proxy= https_proxy= all_proxy=
|
||||||
|
|
||||||
caller_account_id="$(aws sts get-caller-identity --query Account --output text)"
|
caller_account_id="$(aws sts get-caller-identity --query Account --output text)"
|
||||||
if [ "${caller_account_id}" != "${AWS_ACCOUNT_ID}" ]; then
|
if [ "${caller_account_id}" != "${AWS_ACCOUNT_ID}" ]; then
|
||||||
echo "AWS_ACCOUNT_ID does not match caller identity" >&2
|
echo "AWS_ACCOUNT_ID does not match caller identity" >&2
|
||||||
@@ -91,11 +93,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 +104,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