2011-11-09 47 views

回答

7

如果你看一下source code在52行部署的配方,你可以看到:

========================================================================= 
These variables should NOT be changed unless you are very confident in 
what you are doing. Make sure you understand all the implications of your 
changes if you do decide to muck with these! 
========================================================================= 
... 
_cset :shared_children, %w(system log pids) 
... 

这是共享文件夹是如何定义的。我想你可以将下面的行添加到您的Capistrano的食谱,以防止这些目录被符号链接:

set :shared_children, %w() 

更新: 对于下面的评论:随着Capistrano的边缘版本,现在应该工作。请参阅this pull request以减少符号链接的硬编码。

+0

按照您的提示,我检查了源代码,似乎尽管':shared_children'允许您更改创建的目录,但实际的符号链接位由一些粗硬编码完成:https://github.com /capistrano/capistrano/blob/2fd9180125daa4e8dda299bb90e946f2405900e9/lib/capistrano/recipes/deploy.rb#L246 – mjs

+0

好抓!教我,我应该在提交之前测试我的建议。我想你可以重写'finalize_update'任务以防止符号链接这些目录,但它看起来不是正确的方式。 – HectorMalot

+1

请注意,此拉取请求已将其转换为版本2.10(且不在2.9版中) 您可能需要更新您的Capistrano: bundle update capistrano –

相关问题