-
Notifications
You must be signed in to change notification settings - Fork 0
/
buildspec_prod.yaml
34 lines (30 loc) · 1.21 KB
/
buildspec_prod.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
version: 0.2
env:
secrets-manager:
NPM_TOKEN: arn:aws:secretsmanager:us-west-2:779521627844:secret:prod/npmjs/token-rEDLLX
phases:
install:
commands:
- cd packages/cdn/
- PACKAGE_VERSION=$(npm run display-version --silent)
- echo Set PACKAGE_VERSION to $PACKAGE_VERSION
- cd ../..
- echo Setting NPM token
- npm config set //registry.npmjs.org/:_authToken=$NPM_TOKEN
- echo Installing...
- npm install -g [email protected]
- npm ci
build:
commands:
- echo Building...
- npm run build
post_build:
commands:
- echo Replacing current SDK in S3
- aws s3 cp packages/cdn/dist/browser/appfit.js s3://appfit-prod-cdn-storage/browser-sdk/appfit-v1-browser.js
- aws s3 cp packages/cdn/dist/legacy-browser/appfit-legacy.js s3://appfit-prod-cdn-storage/browser-sdk/appfit-v1-legacy.js
- echo Archiving build in S3
- aws s3 cp packages/cdn/dist/browser/appfit.js s3://appfit-prod-cdn-storage/browser-sdk/appfit-v$PACKAGE_VERSION.js
- aws s3 cp packages/cdn/dist/legacy-browser/appfit-legacy.js s3://appfit-prod-cdn-storage/browser-sdk/appfit-legacy-v$PACKAGE_VERSION.js
- echo Publishing to NPM
- npm run deploy:publish