File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -34,6 +34,7 @@ envcount=0
3434volcount=0
3535template=" "
3636TEMPLATE_SKELETON_FILE=" base_template_v2.json"
37+ APP_IMAGE_NAME=" "
3738
3839# variable specific to EBS
3940DOCKERRUN=" Dockerrun.aws.json"
@@ -118,6 +119,14 @@ configure_docker_private_login() {
118119# ECS Deployment Functions
119120
120121ECS_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
573582input_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
576585do
577586 case $OPTION in
578587 d)
582591 usage
583592 exit 1
584593 ;;
594+ i)
595+ APP_IMAGE_NAME=$OPTARG
596+ ;;
585597 e)
586598 ENV=$OPTARG
587599 ;;
You can’t perform that action at this time.
0 commit comments