Last active
September 4, 2018 21:28
-
-
Save astrotars/27d557247c8fcc88782e11eef334fd83 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# exit on first error | |
set -o errexit | |
# output each command | |
set -x | |
cd app | |
cat .env | |
read -n 1 -p "Are you sure these are production settings? (y/n)? " answer | |
if [ "$answer" != "${answer#[Yy]}" ] ;then | |
# set the right homepage variable | |
json -I -f package.json -e 'this.homepage="d1o7mk90rdodoe.cloudfront.net"' | |
yarn build | |
aws s3 sync build/ s3://winds-2-0-hosted | |
# actions.js asset-manifest.json electron.js index.html preload.js service-worker.js | |
aws s3 cp s3://winds-2-0-hosted/index.html s3://winds-2-0-hosted/index.html --metadata-directive REPLACE --cache-control max-age=0,no-cache,no-store,must-revalidate --content-ty | |
pe text/html --acl public-read | |
aws cloudfront create-invalidation --distribution-id E2D9DVHZNXY0VY --paths /index.html | |
else | |
echo No | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment