File tree Expand file tree Collapse file tree 1 file changed +5
-9
lines changed
Expand file tree Collapse file tree 1 file changed +5
-9
lines changed Original file line number Diff line number Diff line change @@ -7,13 +7,12 @@ S3_BUCKET="numbers-static"
77
88# Define S3 keys for paths
99LATEST_KEY=" capture-eye/release/latest/capture-eye.bundled.js"
10- VERSION_KEY=" capture-eye/release/$( npm version --no-git-tag-version patch ) /capture-eye.bundled.js"
10+ VERSION_KEY=" capture-eye/release/$( npm pkg get version | tr -d \" ) /capture-eye.bundled.js"
1111
1212# CloudFront invalidation paths
13- INVALIDATION_PATHS=(
14- " /capture-eye/release/latest/capture-eye.bundled.js"
15- " /capture-eye/release/$( npm version --no-git-tag-version patch) /capture-eye.bundled.js"
16- )
13+ INVALIDATION_PATHS=" /$LATEST_KEY /$VERSION_KEY "
14+
15+ echo " Invalidation paths: $INVALIDATION_PATHS "
1716
1817# Upload to S3 (latest version)
1918aws s3 cp $FILE_PATH s3://$S3_BUCKET /$LATEST_KEY
@@ -31,11 +30,8 @@ if [ $? -ne 0 ]; then
3130fi
3231echo " File uploaded to s3://$S3_BUCKET /$VERSION_KEY "
3332
34- # Create invalidation paths string
35- INVALIDATION_PATHS_STRING=$( printf ' "%s"' " ${INVALIDATION_PATHS[@]} " )
36-
3733# Create the invalidation
38- INVALIDATION_ID=$( aws cloudfront create-invalidation --distribution-id $DISTRIBUTION_ID --paths $INVALIDATION_PATHS_STRING --query ' Invalidation.Id' --output text)
34+ INVALIDATION_ID=$( aws cloudfront create-invalidation --distribution-id $DISTRIBUTION_ID --paths $INVALIDATION_PATHS --query ' Invalidation.Id' --output text)
3935if [ $? -ne 0 ]; then
4036 echo " Failed to create invalidation"
4137 exit 1
You can’t perform that action at this time.
0 commit comments