加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

ruby-on-rails – 在capistrano任务中调用多级capistrano任务

发布时间:2020-12-17 03:09:28 所属栏目:百科 来源:网络整理
导读:我有一个capistrano任务,它整合了Rails项目的多个阶段的部署. 例如: task :consolidated_task do build #creates a new release branch from master,#sets a variable with the relese branch name staging deploy.migrations production deploy.migrations
我有一个capistrano任务,它整合了Rails项目的多个阶段的部署.

例如:

task :consolidated_task do
    build #creates a new release branch from master,#sets a variable with the relese branch name

    staging
    deploy.migrations

    production
    deploy.migrations
end

这是从另一个上限任务调用多阶段任务的正确方法吗?

构建任务创建一个新的git分支并发布它.新分支的名称将保存为capistrano变量.然后,登台和生产阶段任务使用此变量来指定要部署的分支.

当此任务运行时,它会失败:

fatal: working tree '/Users/<my working directory>' already exists.
/usr/local/lib/ruby/gems/1.8/gems/capistrano-2.5.19/lib/capistrano/recipes/deploy/strategy/copy.rb:99:in `initialize': No such file or directory - /var/folders/3d/3dKYNUwQGOSLZFXsMF-uv++++TM/-Tmp-/20100802182750/REVISION (Errno::ENOENT)

我正在从我的本地机器推送源代码作为git存储库,并且部署机器无法相互通信.

解决方法

任务名称如

deploy:production:whatever

在Cap中暴露

deploy.production.whatever

您还可以使用顶级命名空间转到命名空间的顶部,因为路径是相对的.

因此,无论您的任务目前在哪个命名空间,您都可以像以下一样:

top.deploy.production.whatever

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读