Ruby on Rails:Bundler 和 Ruby on Rails Capistrano:指定部署时要排除哪些组(开发、测试)
Bundler 文档说,为了在通过 Capistrano 部署时安装所有必需的捆绑包,只需插入
require 'bundler/capistrano' # siehe http://gembundler.com/deploying.html
他的 deploy.rb 即可。然后,在部署后,Capistrano 会调用
* executing "bundle install --gemfile .../releases/20110403085518/Gemfile \
--path .../shared/bundle --deployment --quiet --without development test"
This Works Fine。
但是,我们在生产服务器上有一个暂存设置,与真实的实时站点隔离,我们在其中使用(克隆和防火墙保护的)实时生产数据测试新的应用程序版本。在那里,我们需要安装测试和开发 gem。
如何在此处指定 capistrano 命令行?是否有我可以使用的参数,或者我是否需要设置自己的 capistrano 任务来覆盖 Bundler 的?
谢谢你!
The Bundler documentation says, that in order to install all necessary bundles when deploying via Capistrano, one need only insert
require 'bundler/capistrano' # siehe http://gembundler.com/deploying.html
in his deploy.rb. Then, upon deployment, Capistrano calls
* executing "bundle install --gemfile .../releases/20110403085518/Gemfile \
--path .../shared/bundle --deployment --quiet --without development test"
This works fine.
However, we have a staging setup on our production server, isolated from the real live site, where we test a new app release with (cloned and firewalled) live production data. There, we need test and development gems to be installed.
How do I specify the capistrano command line here? Are there parameters I can use, or do I need to set up my own capistrano task to overwrite Bundler's?
Thank you!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
编写不同的任务肯定会保持简单:
但是,如果您想使用命令行选项,您可以打开提供的值:
并且在您的deploy.rb文件中,您可以使用选项值:
还有一个更“适当”的配置您可以使用的对象。我在这里找到了对它的引用: http: //ryandaigle.com/articles/2007/6/22/using-command-line-parameters-w-rake-and-capistrano
Writing different tasks would certainly keep it simple:
However, if you want to use command line options you could switch on the supplied value:
And inside your deploy.rb file you could use the option value as:
There's also a more 'proper' configuration object that you can use. I've found a reference to it here: http://ryandaigle.com/articles/2007/6/22/using-command-line-parameters-w-rake-and-capistrano
我认为最干净的方法是使用以下命令在部署环境文件中添加 set :bundle_without :
https://github.com/capistrano/capistrano/wiki/2.x-Multistage-Extension
I think the cleanest way is to just add set :bundle_without in your deploy environment files using this:
https://github.com/capistrano/capistrano/wiki/2.x-Multistage-Extension
我没有独立确认的设置,但是 RAILS_ENV='development' 明白吗?
I don't have a setup to independently confirm, but does RAILS_ENV='development' get it?