-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy.sh
More file actions
executable file
·17 lines (13 loc) · 848 Bytes
/
deploy.sh
File metadata and controls
executable file
·17 lines (13 loc) · 848 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/bash
set -e
AWS_S3_BUCKET_NAME="ugrad.co"
AWS_PROFILE_NAME="ugrad"
AWS_CLOUDFRONT_DISTRIBUTION_ID="E39IZW3AYRY5WN"
echo "Deploying landing"
aws s3 cp --recursive --profile $AWS_PROFILE_NAME --acl public-read dist s3://$AWS_S3_BUCKET_NAME/dist
aws s3 cp --profile $AWS_PROFILE_NAME --acl public-read index.html s3://$AWS_S3_BUCKET_NAME/
echo "Deployed landing"
echo "Creating Cloudfront invalidation..."
AWS_CLOUDFRONT_INVALIDATION_ID=$(aws cloudfront create-invalidation --distribution-id $AWS_CLOUDFRONT_DISTRIBUTION_ID --paths "/*" --profile $AWS_PROFILE_NAME | jq -r ".Invalidation.Id")
echo "Created Cloudfront Invalidation. You can query its status with the following command:"
echo "aws cloudfront get-invalidation --distribution-id $AWS_CLOUDFRONT_DISTRIBUTION_ID --id=$AWS_CLOUDFRONT_INVALIDATION_ID --profile $AWS_PROFILE_NAME"