I have a project I am working on my local computer, and deployed in Heroku Server, with Amazon S3 as its assets repository.
我有一个正在本地计算机上工作的项目,部署在Heroku服务器上,使用Amazon S3作为其资产存储库。
I store everything inside public folder into Amazon server, and this folder is git ignored when pushing to heroku server.
我将所有公共文件夹内的内容都存储到Amazon服务器中,而当推到heroku服务器时,这个文件夹被git忽略。
Problem happens when I have another programmer working on this project. She can upload her assets to Amazon server, and they show correctly online, but I cannot pull her changes.
当我有另一个程序员在做这个项目时,问题就出现了。她可以上传她的资产到亚马逊服务器,并且它们在网上显示正确,但是我不能提取她的改变。
So my question is simple, is there already a rake task to synchronise my public folder with amazon s3 repository?
所以我的问题很简单,是否已经有一个rake任务将我的公共文件夹与amazon s3存储库同步?
Note I am using s3sync application but seems like it only goes one way i.e. I can send whatever in my public folder, but it doesn't get the files in repository.
注意,我使用的是s3sync应用程序,但似乎只有一种方式,即我可以在公共文件夹中发送任何内容,但它不会在存储库中获取文件。
1 个解决方案
#1
1
I've been looking into the same thing, but without Heroku. I think the best thing to do is to check your public assets into version control, and then push those out to s3 when you deploy.
我一直在调查同样的事情,但是没有Heroku。我认为最好的做法是将公共资产检查到版本控制中,然后在部署时将它们推到s3中。
I came across a nice rake script to do this, perhaps it will work for you too:
我遇到了一个很好的rake脚本,也许它也适合你:
https://ariejan.net/2011/01/01/rake-task-to-sync-your-assets-to-amazon-s3cloudfront/
https://ariejan.net/2011/01/01/rake-task-to-sync-your-assets-to-amazon-s3cloudfront/