4

I have a Rails project that I will be deploying to the spectacularly awesome Heroku.

I would really like to be able to automate pushing my resources to Amazon S3 automatically, resources in this case being my images, stylesheets and javascript.

Obviously I can write some sort of capistrano task to do this myself, but does anyone know of something that does this already?

Note: I don't need to be able to upload user-files to S3 as I do that already via paperclip. I am talking about the actual project files required to run the site.

Toby Hede
  • 36,755
  • 28
  • 133
  • 162
  • Why do you want to upload your static assets to S3? To use Cloudfront? To put them in a European bucket? Heroku serves static assets fine, so unless you are doing something fancy, it's really just of matter of the static assets being downloaded from your S3-account (where you pay the bandwidth) or from Heruko's Amazon-hosted servers ;) – Casper Fabricius Nov 15 '09 at 10:46
  • I have been reading the information here regarding File Sizes and Slugs: http://docs.heroku.com/constraints#large-static-assets – Toby Hede Nov 16 '09 at 02:34
  • @Toby The page you linked to is no longer available :( – julien_c Jul 07 '11 at 10:14

4 Answers4

0

I tried Jammit S3, but it didn't have the control I was looking for, so I wrote my own CLI script and just got around to publishing it:

https://github.com/bradt/git-deploy-s3

bradt
  • 531
  • 8
  • 8
0

There is also capistrano-s3 gem which is similar to jammit-s3 but a bit simpler and framework agnostic.

It simply publish all files in your public folder to amazon s3 using capistrano so you may add custom hooks. Have a look at the doc here :

https://github.com/hooktstudios/capistrano-s3

I does not deal with CloudFront invalidations, but I plan on adding this feature.

j15e
  • 518
  • 5
  • 11
0

I found a good article which actually explain about the method to minify, compress and upload the static conetents (js/css) to Amazon S3 using Capistrano script.

Check the article at http://www.makeurownrules.com/ruby-on-rails/minify-compress-synch-amazons3-capistrano

Cheers, Kapil

Kapil
  • 9
  • 1
0

I bumped into your question looking for the same answer. I have good experience with Jammit as an asset packager and I just bumped into a gem which can deploy to S3 and seems to perfectly fit your needs.

https://github.com/railsjedi/jammit-s3

Best, Jeroen

Jevado
  • 146
  • 2