Automate deployment of files to Amazon S3?

2019-02-18 08:43发布

I have a Rails project that I will be deploying to the spectacularly awesome Heroku.

I would really like to be able to automate pushing my resources to Amazon S3 automatically, resources in this case being my images, stylesheets and javascript.

Obviously I can write some sort of capistrano task to do this myself, but does anyone know of something that does this already?

Note: I don't need to be able to upload user-files to S3 as I do that already via paperclip. I am talking about the actual project files required to run the site.

4条回答
爱情/是我丢掉的垃圾
2楼-- · 2019-02-18 09:18

There is also capistrano-s3 gem which is similar to jammit-s3 but a bit simpler and framework agnostic.

It simply publish all files in your public folder to amazon s3 using capistrano so you may add custom hooks. Have a look at the doc here :

https://github.com/hooktstudios/capistrano-s3

I does not deal with CloudFront invalidations, but I plan on adding this feature.

查看更多
祖国的老花朵
3楼-- · 2019-02-18 09:23

I tried Jammit S3, but it didn't have the control I was looking for, so I wrote my own CLI script and just got around to publishing it:

https://github.com/bradt/git-deploy-s3

查看更多
做自己的国王
4楼-- · 2019-02-18 09:24

I bumped into your question looking for the same answer. I have good experience with Jammit as an asset packager and I just bumped into a gem which can deploy to S3 and seems to perfectly fit your needs.

https://github.com/railsjedi/jammit-s3

Best, Jeroen

查看更多
ら.Afraid
5楼-- · 2019-02-18 09:31

I found a good article which actually explain about the method to minify, compress and upload the static conetents (js/css) to Amazon S3 using Capistrano script.

Check the article at http://www.makeurownrules.com/ruby-on-rails/minify-compress-synch-amazons3-capistrano

Cheers, Kapil

查看更多
登录 后发表回答