shared_children不适用于Capistrano 3 [英] shared_children not working in Capistrano 3

查看:143
本文介绍了shared_children不适用于Capistrano 3的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的 deploy.rb 中有以下内容:

I have the following in my deploy.rb:

set :upload_dirs, %w(public/pictures)
set :shared_children, (fetch(:shared_children) || []) + fetch(:upload_dirs)

这似乎是建议的方法,让我共享公共目录。

This seems to be the suggested method to allow me to have the public directory shared.

public / pictures 目录存在,并在存储库中检查为空。我试图在存储库中也没有它,但是它不起作用。

The public/pictures directory exists and is checked in empty in the repository. I tried to also not have it in the repository but it didn't work anyway.

当我使用capistrano进行部署时,我看不到公开/图片目录出现在我的部署位置的任何地方。

When I deploy with capistrano, I don't see the public/pictures directory appearing anywhere in my deploy location.

此功能是否已从Capistrano 3中删除?
Capistrano 3有明确的文件来源吗?所有我可以找到的是Capistrano 2文档和非常稀缺的信息来源v3。

Has this feature been removed from Capistrano 3? Is there a definitive source of documentation for Capistrano 3? All I can find is Capistrano 2 documentation and very scarce sources of information for v3.

推荐答案

这似乎是一个没有文档的变化Capistrano 2到3.在新版本中,名称似乎是:linked_dirs

This seems to be an undocumented change from Capistrano 2 to 3. In the new version, the name seems to be :linked_dirs.

我更新了我的代码这样:

I updated my code as such:

set :linked_files, %w(config/database.yml config/application.yml)
set :linked_dirs, %w(public/pictures)

我也有机会使用新的code>:linked_files 功能,允许您将共享目录中的文件直接链接到当前应用程序,而不必为其编写自定义任务。

I also took the chance to use the new :linked_files feature, which allows you to link files found in the shared directory directly into your current application without having to write custom tasks for it.

两个变量似乎都是 nil 起初,所以你不必获取当前的值来附加你自己的目录。

Both variables seem to be nil at first, so you don't have to fetch the current value to append your own directories to them.

这篇关于shared_children不适用于Capistrano 3的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆