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
34
34
volcount=0
35
35
template=" "
36
36
TEMPLATE_SKELETON_FILE=" base_template_v2.json"
37
+ APP_IMAGE_NAME=" "
37
38
38
39
# variable specific to EBS
39
40
DOCKERRUN=" Dockerrun.aws.json"
@@ -118,6 +119,14 @@ configure_docker_private_login() {
118
119
# ECS Deployment Functions
119
120
120
121
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
121
130
log " Pushing Docker Image..."
122
131
eval $( aws ecr get-login --region $AWS_REGION --no-include-email)
123
132
docker push $AWS_ACCOUNT_ID .dkr.ecr.$AWS_REGION .amazonaws.com/$AWS_REPOSITORY :$ECS_TAG
@@ -572,7 +581,7 @@ deploy_lambda_package()
572
581
# Input Collection and validation
573
582
input_parsing_validation ()
574
583
{
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
576
585
do
577
586
case $OPTION in
578
587
d)
582
591
usage
583
592
exit 1
584
593
;;
594
+ i)
595
+ APP_IMAGE_NAME=$OPTARG
596
+ ;;
585
597
e)
586
598
ENV=$OPTARG
587
599
;;
You can’t perform that action at this time.
0 commit comments