forked from rudderlabs/rudder-sdk-js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
buildspec.staging.yaml
22 lines (20 loc) · 978 Bytes
/
buildspec.staging.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
version: 0.2
phases:
install:
runtime-versions:
nodejs: 10
build:
commands:
- ls
- npm install --unsafe-perm
- npm run prodTest && npm test
- npm run buildProdBrowser
- sed 's|//# sourceMappingURL=rudder-analytics.min.js.map||' dist/rudder-analytics.min.js > dist/prod.js
- mv dist/prod.js dist/rudder-analytics.min.js
- aws s3 cp dist/rudder-analytics.min.js s3://$S3_BUCKET_NAME/rudder-analytics-staging.min.js --cache-control max-age=3600 --acl public-read
- aws s3 cp dist/rudder-analytics.min.js s3://$S3_BUCKET_NAME/v1/rudder-analytics-staging.min.js --cache-control max-age=3600 --acl public-read
- aws cloudfront create-invalidation --distribution-id $CLOUDFRONT_DISTRIBUTION_ID --paths "/v1/rudder-analytics-staging.min.js"
- aws cloudfront create-invalidation --distribution-id $CLOUDFRONT_DISTRIBUTION_ID --paths "/rudder-analytics-staging.min.js"
artifacts:
files:
- "**/*"