Andrew Hopper
Andrew Hopper

Reputation: 976

Rails/Capistrano tool to deploy static assets to Rackspace Cloud Files or Amazon Cloud Front?

Is anyone aware of a tool that will automatically deploy a Rails app static assets to Rackspace Cloud Files or Amazon Cloud Front?

In my perfect world capistrano would automatically upload everything in javascripts, stylesheets, and images then override the default image_tag and script_tags to route to the appropriate CDN path.

It would be great if the deploy task created a new container with each deploy like cap creates a new release directory, or maybe it should use the same containers and keep a cached file with the hashes of all the deployed assets and only deploy new assets to take advantage of long CDN TTLs.

Upvotes: 1

Views: 1214

Answers (3)

Phil
Phil

Reputation: 2807

I have previously used Rackspace Cloud Files CloudFuse for Linux http://www.rackspace.com/knowledge_center/article/mounting-rackspace-cloud-files-to-linux-using-cloudfuse.

It allows you to mount your cloud files containers so that they can be written using standard file system operations, which makes for simple scripting in your deploy scripts. You'll obviously want to take care of keeping the machine that does this secure.

Upvotes: 0

Sathish Manohar
Sathish Manohar

Reputation: 6119

I haven't done it myself yet, but I think it can be done with rsync as a capistrano task.

Have look at this.

http://railscasts.com/episodes/133-capistrano-tasks

Upvotes: 0

gjb
gjb

Reputation: 6317

I'm not aware of anything, but you could probably script something to do this without too much work.

The Fog gem provides an agnostic API for pushing files to Amazon S3 and Rackspace Cloud files, among others.

Upvotes: 2

Related Questions