12

How can I deploy my precompiled assets of Rails 3.1 pipeline to s3?

I need a task to automate this syncing work with my assets bucket.

EDIT:

This gem is exactly which I need: https://github.com/rumblelabs/asset_sync.

Edison Machado
  • 1,410
  • 19
  • 29

2 Answers2

6

I think, that this shouldn't be a problem. The filename is the result of the content of the given file. And if you compile the files, upload them to S3 and update your environment.

config.action_controller.asset_host = "http://assets.example.com"

I guess it should work.

  • This is a part of solution. But I want something like Capistrano task to push my changed precompiled assets to s3. I want to deploy, not a manually upload, any suggestion? Thanks! – Edison Machado Jun 18 '11 at 22:28
  • You can fire rake assets:precompile And then, this gem can help you to upload the compiled files to s3. https://github.com/moocode/asset_id Maybe you have to change one route... – Daniel Spangenberg Jun 26 '11 at 16:03
1

Take a peek at the jammit-s3 project, for a good start at getting your compiled assets up to Amazon S3. I've been using it on a Rails 3 project that uses jammit for asset management. I was planning to take a crack at tweaking jammit-s3 to work with the Rails 3.1 asset pipeline. I stumbled onto your question while checking to see if anyone had else had already done so. Now that Rails 3.1 has been officially released, I'm confident that a good solution will be developed.

M. Scott Ford
  • 2,859
  • 1
  • 23
  • 24