Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/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