Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to deploy (sync) Rails 3.1 precompiled assets with Amazon s3

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.

like image 909
Edison Machado Avatar asked Jun 13 '11 18:06

Edison Machado


2 Answers

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.

like image 75
Daniel Spangenberg Avatar answered Sep 29 '22 12:09

Daniel Spangenberg


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.

like image 28
M. Scott Ford Avatar answered Sep 29 '22 11:09

M. Scott Ford