This file contains hidden or 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 | |
# output format is like this: | |
# upload: index.html to s3://$BUCKET/index.html | |
# | |
# so we grab the second item which is the file path and pass that via xargs to the | |
# cloudfront invalidation command | |
aws s3 sync --sse AES256 s3://$BUCKET/ site/ | awk '{print $2;}' | \ | |
xargs aws cloudfront create-invalidation --distribution-id $CF_DISTRO_ID --paths |