-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy-staging
More file actions
executable file
·20 lines (15 loc) · 1.04 KB
/
deploy-staging
File metadata and controls
executable file
·20 lines (15 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/usr/bin/env bash
npm run build
#determine the version of the code we are currently on
TAG_VERSION=$(git describe --tags)
#use that to build our deploy url and push to proper folder in S3
DEPLOY_URL_MINIFIED="s3://cdn.staging.mobials.com/analytics/$TAG_VERSION/analytics.min.js"
DEPLOY_URL="s3://cdn.staging.mobials.com/analytics/$TAG_VERSION/analytics.js"
LATEST_DEPLOY_URL_MINIFIED="s3://cdn.staging.mobials.com/analytics/latest/analytics.min.js"
LATEST_DEPLOY_URL="s3://cdn.staging.mobials.com/analytics/latest/analytics.js"
aws s3 cp index.min.js ${DEPLOY_URL_MINIFIED} --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers
aws s3 cp index.browserified.js ${DEPLOY_URL} --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers
#and do another deploy to the latest directory
aws s3 cp index.min.js ${LATEST_DEPLOY_URL_MINIFIED} --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers
aws s3 cp index.browserified.js ${LATEST_DEPLOY_URL} --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers
rm index.browserified.js