Deploy with rsync and purge the CDN with curl
If you work with rsync to deploy static content to your webserver and what to purge those files from your Fastly CDN here is the script.
What the script does:
- Create a tempfile to store the rsynced files.
- rsync the files and log everything in the tempfile.
- Loop through the tempfile. Do some bash magic to run a curl -X PURGE on all synced files.
- Delete the tempfile.