With my move to Heroku I felt bad about having Heroku's app servers serve static content for me. It's not really a problem, but I just like to use the best tool available for the job.
Because _Ariejan.net_ is a rack app, it has a `public` directory with all static assets in once place. There are, however, a few problems that need adressing.
~
These are the problems I want to resolve:
#### Keep my S3 Bucket in sync with my public directory ####
The first and foremost is to keep my S3 bucket in sync with the content of `public`. I don't care about file deletions, but I do care about new and updated files. Those should be synced with every deployment to S3.
#### Don't re-upload the entire public directory with every deployment ####
Over time the size of `public` has grown. New images are added all the time. I don't want to re-upload them with every deployment. So, my sync script must be smart enough to not upload unchanged files.
#### Hook the S3 sync into my current deployment rake task ####
My current rake deploy task should be able to call `assets:deploy` or something to trigger an asset sync.
This rake task is hooked into my `rake deploy:production` script and generates the following output (I added a new file just to show you what happens.)
It's very easy to write your own S3 sync script. My version has still has some issues/missing features that I may or may not add at some later time. There's no support for file deletions and error handling is very poor at this time. Also, `public` is still under version control (where I want it), and is pushed to Heroku. This is non-sense, because most of the assets in `public` are not used (except `robots.txt` and `favicon.ico`)