Skip to content

Commit

Permalink
update build file
Browse files Browse the repository at this point in the history
  • Loading branch information
sayan-rudder committed Jun 10, 2020
1 parent 0a2c670 commit db0befd
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
2 changes: 1 addition & 1 deletion buildspec.yml → buildspec.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ phases:
- mv dist/prod.js dist/rudder-analytics.min.js
post_build:
commands:
- aws s3 cp dist/rudder-analytics.min.js s3://test-js-pipeline/rudder-analytics.min.js --metadata '{"max-age":"3600"}'
- aws s3 cp dist/rudder-analytics.min.js s3://$S3_BUCKET_NAME/rudder-analytics.min.js
artifacts:
files:
- "**/*"
23 changes: 23 additions & 0 deletions buildspec.prod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
version: 0.2

phases:
install:
runtime-versions:
nodejs: 10
build:
commands:
- ls
- npm install --unsafe-perm
- npm run prodTest
- npm run buildProdBrowser
- sed 's|rudder-analytics.min.js.map|https://cdn.rudderlabs.com/rudder-analytics.min.js.map|' dist/rudder-analytics.min.js > dist/prod.js
- mv dist/prod.js dist/rudder-analytics.min.js
post_build:
commands:
- aws s3 cp dist/rudder-analytics.min.js s3://$S3_BUCKET_NAME/rudder-analytics.min.js --metadata '{"Cache-Control":"max-age=3600"}'
- aws s3 cp dist/rudder-analytics.min.js s3://$S3_BUCKET_NAME/v1/rudder-analytics.min.js --metadata '{"Cache-Control":"max-age=3600"}'
- aws cloudfront create-invalidation --distribution-id $CLOUDFRONT_DISTRIBUTION_ID --paths "/v1/rudder-analytics.min.js"
- aws cloudfront create-invalidation --distribution-id $CLOUDFRONT_DISTRIBUTION_ID --paths "/rudder-analytics.min.js"
artifacts:
files:
- "**/*"

0 comments on commit db0befd

Please sign in to comment.