Skip to content

Instantly share code, notes, and snippets.

@bkazez
Last active April 27, 2019 19:45
Show Gist options
  • Save bkazez/7596ec8dea95646dca5630bf49188682 to your computer and use it in GitHub Desktop.
Save bkazez/7596ec8dea95646dca5630bf49188682 to your computer and use it in GitHub Desktop.
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment