Skip to content

Instantly share code, notes, and snippets.

@astrotars
Last active September 4, 2018 21:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save astrotars/27d557247c8fcc88782e11eef334fd83 to your computer and use it in GitHub Desktop.
Save astrotars/27d557247c8fcc88782e11eef334fd83 to your computer and use it in GitHub Desktop.
#!/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