Copy Photos to Staging S3 (using rails and paperclip)

I've got a website built on rails that uses paperclip to persist photos to S3. This works great. I'm using Heroku, so i've also got a staging server set up for future changes and user testing. Following the 12factor Dev/Prod parity http://www.12factor.net/dev-prod-parity in mind I've been using PGbackups to keep the same data in staging as in production. However I can't find a good way to sync my production S3 bucket to staging.

I don't want to use my production S3 bucket in staging for fear of accidentally deleting production photos. Having missing photos show up durring user testing is distracting and unacceptable. Is there an easy solution to push the same photo to two buckets while saving, or to set staging to be a "slave" to the production bucket in S3?


You can run a script to copy your production bucket to staging whevener you synchronize your database: Googling a bit I've found this one. You can wrap it in a rake task and run it from your staging app.


The most recent best answer is on a similar question:

Best way to move files between S3 buckets?

Scroll down until you see the answer by alberge

链接地址: http://www.djcxy.com/p/85098.html

上一篇: npm postinstall脚本根据enviro运行grunt任务

下一篇: 将照片复制到舞台S3(使用导轨和回形针)