Skip to content

Commit ea9de02

Browse files
Gunasekar KGunasekar K
Gunasekar K
authored and
Gunasekar K
committed
Converting non standard image to standard format
1 parent 0883ada commit ea9de02

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

master_deply_v4.2.sh

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ envcount=0
3434
volcount=0
3535
template=""
3636
TEMPLATE_SKELETON_FILE="base_template_v2.json"
37+
APP_IMAGE_NAME=""
3738

3839
#variable specific to EBS
3940
DOCKERRUN="Dockerrun.aws.json"
@@ -118,6 +119,14 @@ configure_docker_private_login() {
118119
#ECS Deployment Functions
119120

120121
ECS_push_ecr_image() {
122+
if [ -z "$APP_IMAGE_NAME" ];
123+
then
124+
log "Image has followed standard format"
125+
else
126+
log "Image does not follow stanard format. Modifying the image and updating the ECS_TAG"
127+
docker tag $APP_IMAGE_NAME:$ECS_TAG $AWS_ACCOUNT_ID.dkr.ecr.$AWS_REGION.amazonaws.com/$AWS_REPOSITORY:$CIRCLE_BUILD_NUM
128+
ECS_TAG=$CIRCLE_BUILD_NUM
129+
fi
121130
log "Pushing Docker Image..."
122131
eval $(aws ecr get-login --region $AWS_REGION --no-include-email)
123132
docker push $AWS_ACCOUNT_ID.dkr.ecr.$AWS_REGION.amazonaws.com/$AWS_REPOSITORY:$ECS_TAG
@@ -572,7 +581,7 @@ deploy_lambda_package()
572581
# Input Collection and validation
573582
input_parsing_validation()
574583
{
575-
while getopts .d:h:e:t:v:s:p:g:c:. OPTION
584+
while getopts .d:h:i:e:t:v:s:p:g:c:. OPTION
576585
do
577586
case $OPTION in
578587
d)
@@ -582,6 +591,9 @@ do
582591
usage
583592
exit 1
584593
;;
594+
i)
595+
APP_IMAGE_NAME=$OPTARG
596+
;;
585597
e)
586598
ENV=$OPTARG
587599
;;

0 commit comments

Comments
 (0)