Skip to content

Instantly share code, notes, and snippets.

@bkazez
bkazez / middleman_deploy_s3_cloudfront
Last active April 27, 2019 19:45
Get changed paths from middleman s3_sync, for CDN invalidation (Cloudfront, etc)
# additions aren't necessary for cache invalidation
changedpaths="$(middleman s3_sync -B | grep -E "^ +(updated|remove)" | awk '{print $2}' | sed -e 's/^build//')"
aws cloudfront create-invalidation --distribution-id xxx --paths $changedpaths --profile yyy