forked from chat21/chat21-web-widget
-
Notifications
You must be signed in to change notification settings - Fork 19
/
deploy_amazon_prod.sh
executable file
·27 lines (22 loc) · 1.09 KB
/
deploy_amazon_prod.sh
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
# npm version patch
version=`node -e 'console.log(require("./package.json").version)'`
echo "version $version"
# --build-optimizer=false if localstorage is disabled (webview) appears https://github.com/firebase/angularfire/issues/970
ng build --configuration="prod" --aot=true --build-optimizer=true --vendor-chunk=true
#### FIREBASE #####
# cd dist
# # aws s3 sync . s3://tiledesk-widget/v5/latest/
# aws s3 sync . s3://tiledesk-widget/v5/$version/ --cache-control max-age=300
# aws s3 sync . s3://tiledesk-widget/v5/ --cache-control max-age=300
# cd ..
# #### MQTT #####
cd dist
# aws s3 sync . s3://tiledesk-widget/v5/latest/
aws s3 sync . s3://tiledesk-widget/v6/$version/ --cache-control max-age=300
aws s3 sync . s3://tiledesk-widget/v6/ --cache-control max-age=300
cd ..
aws cloudfront create-invalidation --distribution-id E3EJDWEHY08CZZ --paths "/*"
echo new version deployed $version on s3://tiledesk-widget/v5
echo available on https://s3.eu-west-1.amazonaws.com/tiledesk-widget/v5/index.html
echo https://widget.tiledesk.com/v5/index.html
echo https://widget.tiledesk.com/v5/$version/index.html