From 32493f12ba7191cffe8a3df8d16b629eb64871a4 Mon Sep 17 00:00:00 2001 From: larisa17 Date: Mon, 29 Jul 2024 16:37:09 +0300 Subject: [PATCH] feat(infra): update check ecr image --- .github/workflows/deploy_generic.yml | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/.github/workflows/deploy_generic.yml b/.github/workflows/deploy_generic.yml index ed742d8761..d31d882fd1 100644 --- a/.github/workflows/deploy_generic.yml +++ b/.github/workflows/deploy_generic.yml @@ -64,15 +64,11 @@ jobs: ECR_REPO_NAME=passport IMAGE_URI=${ACCOUNT_ID}.dkr.ecr.${REGION}.amazonaws.com/${ECR_REPO_NAME}:${IMAGE_TAG} - if aws ecr describe-images --repository-name ${ECR_REPO_NAME} --image-ids imageTag=${IMAGE_TAG} > /dev/null 2>&1; then - echo "Image exists: ${IMAGE_URI}" - echo "::set-output name=image_exists::true" - else - echo "Image does not exist: ${IMAGE_URI}" - echo "::set-output name=image_exists::false" + aws ecr describe-images --repository-name ${ECR_REPO_NAME} --image-ids imageTag=${IMAGE_TAG} + if [ $? -ne 0 ]; then + echo "Image not found in ECR" exit 1 fi - deploy_preview: name: Preview - Deploying AWS Infra needs: [verify_image_ecr]