Skip to content

Commit

Permalink
get Dev image for Dev fronetend deployment (#1626)
Browse files Browse the repository at this point in the history
  • Loading branch information
pskushwaha1 authored May 22, 2024
1 parent 20a7a10 commit f3273f8
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions ci/terraform/get_image.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,27 @@

set -euo pipefail

GITHUB_SHA=$1
REGISTRY_ID=114407264696
GITHUB_SHA="${1}"
ENVIRONMENT="${2}"
FRONTEND_REPO_NAME=frontend-image-repository
SIDECAR_REPO_NAME=basic-auth-sidecar-image-repository

echo "Setting the ECR repo registry ID"
# If Enviorment is DEV then pull image from tools-dev Dev account to deploy Dev frontend
# Else pull image from tools-prod to deploy ( Build , integration , Staging & prod ) frontend

if [ "$ENVIRONMENT" = "dev" ]; then
REGISTRY_ID=$(aws ssm get-parameter --name "AUTH_DEV_TOOLS_ACT_ID" --with-decryption --query 'Parameter.Value' --output text)
else
REGISTRY_ID=$(aws ssm get-parameter --name "AUTH_PROD_TOOLS_ACT_ID" --with-decryption --query 'Parameter.Value' --output text)
fi

echo "Loading frontend image..."

frontend_image=$(aws ecr batch-get-image \
--repository-name $FRONTEND_REPO_NAME \
--image-ids "imageTag=${GITHUB_SHA}" \
--registry-id $REGISTRY_ID \
--registry-id "$REGISTRY_ID" \
--region eu-west-2 \
--output text \
--query 'images[0].imageId.imageDigest')
Expand All @@ -22,7 +32,7 @@ echo "Loading sidecar image..."
sidecar_image=$(aws ecr batch-get-image \
--repository-name $SIDECAR_REPO_NAME \
--image-ids "imageTag=${GITHUB_SHA}" \
--registry-id $REGISTRY_ID \
--registry-id "$REGISTRY_ID" \
--region eu-west-2 \
--output text \
--query 'images[0].imageId.imageDigest')
Expand Down

0 comments on commit f3273f8

Please sign in to comment.