Rails/Capistrano 工具可将静态资产部署到 Rackspace Cloud Files 或 Amazon Cloud Front?
有人知道有一个工具可以自动将 Rails 应用程序静态资产部署到 Rackspace Cloud Files 或 Amazon Cloud Front 吗?
在我的完美世界中,capistrano 会自动上传 JavaScript、样式表和图像中的所有内容,然后覆盖默认的 image_tag 和 script_tags 以路由到适当的 CDN 路径。
如果部署任务创建一个新的容器,每个部署都创建一个新的容器,比如 cap 创建一个新的发布目录,或者它应该使用相同的容器并保留一个包含所有已部署资产的哈希值的缓存文件,并且仅将新资产部署到利用长 CDN TTL 的优势。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我什么都不知道,但您可能可以编写一些脚本来完成此操作,而无需太多工作。
Fog gem 提供了一个不可知的 API,用于将文件推送到 Amazon S3 和 Rackspace Cloud 文件等。
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.
我自己还没有做过,但我认为可以用 rsync 作为 capistrano 任务来完成。
看看这个。
http://railscasts.com/episodes/133-capistrano-tasks
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
我之前使用过适用于 Linux 的 Rackspace 云文件 CloudFuse http://www.rackspace.com/knowledge_center/article/mounting-rackspace-cloud-files-to-linux-using-cloudfuse。
它允许您挂载云文件容器,以便可以使用标准文件系统操作编写它们,这使得您的部署脚本中的脚本编写变得简单。显然,您需要注意确保执行此操作的机器的安全。
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.