diff --git a/.circleci/test-deploy.yml b/.circleci/test-deploy.yml index 47e272b..9102b55 100644 --- a/.circleci/test-deploy.yml +++ b/.circleci/test-deploy.yml @@ -386,4 +386,4 @@ executors: machine: image: ubuntu-2204:current docker_layer_caching: true - resource_class: arm.medium \ No newline at end of file + resource_class: arm.medium diff --git a/src/scripts/ecr_login.sh b/src/scripts/ecr_login.sh index a5e49f6..212d10f 100644 --- a/src/scripts/ecr_login.sh +++ b/src/scripts/ecr_login.sh @@ -47,11 +47,17 @@ configure_config_json(){ install_aws_ecr_credential_helper(){ echo "Installing AWS ECR Credential Helper..." if [[ "$SYS_ENV_PLATFORM" = "linux" ]]; then - $SUDO apt update - $SUDO apt install amazon-ecr-credential-helper + HELPER_INSTALLED=$(dpkg --get-selections | (grep amazon-ecr-credential-helper || test $?) | awk '{print $2}') + if [[ "$HELPER_INSTALLED" != "install" ]]; then + $SUDO apt update + $SUDO apt install amazon-ecr-credential-helper + fi configure_config_json elif [[ "$SYS_ENV_PLATFORM" = "macos" ]]; then - brew install docker-credential-helper-ecr + HELPER_INSTALLED=$(brew list -q | grep -q docker-credential-helper-ecr || test $?) + if [[ "$HELPER_INSTALLED" -ne 0 ]]; then + brew install docker-credential-helper-ecr + fi configure_config_json else docker logout "${AWS_ECR_VAL_ACCOUNT_URL}"