Compare commits
15 Commits
dev
..
0a9c026b1b
| Author | SHA1 | Date | |
|---|---|---|---|
| 0a9c026b1b | |||
| 29aafa5999 | |||
| 0c6c4cfa82 | |||
| e17afac339 | |||
| 9cdfee1596 | |||
| 13b8e047c2 | |||
| f2c3c795e7 | |||
| 46394ffcdf | |||
| 786acfe010 | |||
| 2657a7a339 | |||
| 7a84bb5d16 | |||
| 5da1cba851 | |||
| a2ce6d8502 | |||
| fd4fae318d | |||
| 1acd4be28e |
@@ -73,8 +73,6 @@ jobs:
|
||||
ECR_REPOSITORY: ${{ secrets.ECR_REPOSITORY }}
|
||||
run: |
|
||||
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)"
|
||||
if [ "${caller_account_id}" != "${AWS_ACCOUNT_ID}" ]; then
|
||||
echo "AWS_ACCOUNT_ID does not match caller identity" >&2
|
||||
@@ -93,6 +91,11 @@ jobs:
|
||||
--image-scanning-configuration scanOnPush=true \
|
||||
--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() {
|
||||
for attempt in 1 2 3; do
|
||||
if "$@"; then
|
||||
@@ -104,14 +107,6 @@ jobs:
|
||||
sleep "$((attempt * 5))"
|
||||
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"
|
||||
|
||||
untagged_image_ids="$(aws ecr list-images \
|
||||
|
||||
Reference in New Issue
Block a user