Horje
cloudfront remove cache after deploy S3 Code Example
cloudfront remove cache after deploy S3
#!/usr/bin/env bash

BUCKET=mysite.com
SOURCE_DIR=dist/

export AWS_ACCESS_KEY_ID=xxxxxxxxxxx
export AWS_SECRET_ACCESS_KEY=xxxxxxxxx
export AWS_DEFAULT_REGION=eu-west-1


echo "Building production"
if npm run build:prod ; then
   echo "Build Successful"
else
  echo "exiting.."
  exit 1
fi


echo "Removing all files on bucket"
aws s3 rm s3://${BUCKET} --recursive


echo "Attempting to upload site .."
echo "Command:  aws s3  sync $SOURCE_DIR s3://$BUCKET/"
aws s3  sync ${SOURCE_DIR} s3://${BUCKET}/
echo "S3 Upload complete"

echo "Invalidating cloudfrond distribution to get fresh cache"
aws cloudfront create-invalidation --distribution-id=S11A16G5KZMEQD --paths / --profile=myawsprofile

echo "Deployment complete"  




Shell

Related
jupyter digits Code Example jupyter digits Code Example
descobrir se porta esta aberta terminal linux telnet Code Example descobrir se porta esta aberta terminal linux telnet Code Example
start automount daemon aix Code Example start automount daemon aix Code Example
github authentication timeout linux Code Example github authentication timeout linux Code Example
install minikube Chocolatey Code Example install minikube Chocolatey Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
10