简体   繁体   English

如何使上限部署链接到我的供应商文件夹?

[英]How to make cap deploy link my vendors folder?

I would like to link my vendor folder so I don't have 5 minutes down time every time I deploy and have to run bundle install --deployment. 我想链接我的供应商文件夹,这样我每次部署时都不会有5分钟的停机时间,而不必运行bundle install --deployment。

Thanks! 谢谢!

可能是你可以在Capistrano的部署后,用耙子任务, 例如

One option is to create a new task to symlink vendor to the shared path and set it to run before bundle:install , but this is a little unnecessary - it'd be nicer to just bundle to the shared path in the first place instead of vendor. 一种选择是创建一个新任务,以将供应商符号链接到共享路径,并将其设置为在bundle:install之前运行。但这是不必要的-最好是首先绑定到共享路径而不是供应商。

If you're requiring and using 'bundler/capistrino' in your deploy.rb file, all you need to do is set bundle_dir and bundler will pick it up: 如果您需要在deploy.rb文件中使用'bundler / capistrino',则只需设置bundle_dir ,bundler会选择它:

set :bundle_dir, File.join(fetch(:shared_path), 'bundle')

If you've written your own bundle task, set the variable as above, then use --path #{fetch(:bundle_dir)} in the task. 如果您编写了自己的捆绑包任务,请按上述设置变量,然后在任务中使用--path #{fetch(:bundle_dir)}

更新最新版本的Capistrano很有帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM