Skip to content

Commit 2da65e4

Browse files
committed
Try CF invalidation
1 parent e33a40e commit 2da65e4

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

bitbucket-pipelines.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,11 +218,13 @@ definitions:
218218
name: Find and Invalidate CloudFront Cache
219219
image: amazon/aws-cli
220220
script:
221-
- aws configure set aws_access_key_id $AWS_ACCESS_KEY_ID
222-
- aws configure set aws_secret_access_key $AWS_SECRET_ACCESS_KEY
221+
- aws configure set aws_access_key_id $AWS_ACCESS_CF_KEY_ID
222+
- aws configure set aws_secret_access_key $AWS_SECRET_ACCESS_CF_KEY
223223
- aws configure set default.region $AWS_REGION
224224
- export CLOUDFRONT_NAME=$(echo "$BITBUCKET_BRANCH" | awk -F'/' '{if(NF==1)val=$1;else if(NF==2)val=$2;else if(NF==3)val=$2;else val=$3;gsub(/_/, "-", val);print tolower(val)}')
225+
- echo $CLOUDFRONT_NAME
225226
- export CLOUDFRONT_DISTRIBUTION_ID=$(aws cloudfront list-distributions --query "DistributionList.Items[?Comment=='dev--$CLOUDFRONT_NAME'].Id" --output text)
227+
- echo $CLOUDFRONT_DISTRIBUTION_ID
226228
- aws cloudfront create-invalidation --distribution-id $CLOUDFRONT_DISTRIBUTION_ID --paths "/*"
227229

228230
- step: &find-and-invalidate-cloudfront-staging
@@ -253,6 +255,8 @@ pipelines:
253255
- step: *turn-on-dev
254256
turn-on-staging:
255257
- step: *turn-on-staging
258+
invalidate-cloudfront-dev:
259+
- step: *find-and-invalidate-cloudfront-dev
256260
branches:
257261
'dspace-cris-2024_02_x':
258262
- step: *preliminary-operation

0 commit comments

Comments
 (0)