Skip to content

Commit d66fbb0

Browse files
committed
validate cache issue
1 parent 54d1e9d commit d66fbb0

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

master_deploy.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ ebstemplate=""
7070
#AWS_S3_BUCKET=""
7171
#AWS_S3_SOURCE_SYNC_PATH=""
7272
CFCACHE="false"
73+
AWS_CLOUD_FRONT_ID=""
7374

7475
# Variables for Lambda
7576
#AWS_LAMBDA_DEPLOY_TYPE=""
@@ -696,6 +697,18 @@ deploy_s3bucket() {
696697
done;
697698
}
698699

700+
invalidate_cf_cache()
701+
{
702+
if [ "$CFCACHE" = "true" ]; then
703+
if [ -z $AWS_CLOUD_FRONT_ID ]; then
704+
echo "Based on header applicaiton has invalidated"
705+
echo "Skipped which is based on AWS cloudfront ID.Kindly raise request to configure cloud front ID in deployment configuration"
706+
else
707+
aws cloudfront create-invalidation --distribution-id $AWS_CLOUD_FRONT_ID --paths '/*'
708+
fi
709+
fi
710+
}
711+
699712
download_envfile()
700713
{
701714
Buffer_seclist=$(echo $SEC_LIST | sed 's/,/ /g' )
@@ -1127,6 +1140,7 @@ main()
11271140
if [ "$DEPLOYMENT_TYPE" == "CFRONT" ]
11281141
then
11291142
deploy_s3bucket
1143+
invalidate_cf_cache
11301144
fi
11311145

11321146
if [ "$DEPLOYMENT_TYPE" == "LAMBDA" ]

0 commit comments

Comments
 (0)