Prod Deploy script updated:

This commit is contained in:
Manoj Vivek 2019-10-26 23:26:34 +05:30
parent 827b002324
commit e37fa1725b

View file

@ -1,3 +1,21 @@
#!/bin/bash
# Build the code
npm run build
# Clean-up unwanted files
ls -l dist/*.html | grep -v /index.html | grep -v /download.html | awk '{ print $9 }' | xargs rm
rm -rf dist/documentation
# Fix the production Account IDs
## Heap
find ./dist/ -iname *.html -exec sed -i '' -e 's/4003482642/3340058302/g' {} \;
## Google Analytics
find ./dist/ -iname *.html -exec sed -i '' -e 's/UA-150751006-2/UA-150751006-1/g' {} \;
## Razorpay
find ./dist/ -iname *.html -exec sed -i '' -e 's/rzp_test_DVeigAo0o0my9U/rzp_live_KeUvdjN006L82W/g' {} \;
# Upload to S3
aws s3 sync ./dist s3://responsively.app --delete --acl public-read
aws cloudfront create-invalidation --distribution-id E30WYS4T1RMPPE --paths "/*"
aws cloudfront create-invalidation --distribution-id E30WYS4T1RMPPE --paths "/*"