Rails/Capistrano tool to deploy static assets to R

2020-07-30 02:37发布

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.

3条回答
戒情不戒烟
2楼-- · 2020-07-30 03:13

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

查看更多
做自己的国王
3楼-- · 2020-07-30 03:19

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.

查看更多
对你真心纯属浪费
4楼-- · 2020-07-30 03:29

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.

查看更多
登录 后发表回答