任务:不推荐使用after_update_code ...最新的写法是什么

时间:2011-03-21 18:06:01

标签: ruby-on-rails capistrano

所以我使用它作为我当前的after_update

task :after_update_code, :roles => :app do
    do_something
end

但在部署时我收到此错误消息

 before_ and after_ is deprecated, please see the new before() and after() methods

我看了看,试着写这个

after :update_code, :roles => app do
    do_something
end

但是卡皮斯特拉诺忽略了它。 更新此内容的正确方法是什么?

1 个答案:

答案 0 :(得分:8)

请注意'看'不是'使用'。 (Guh。总是很难找到capistrano文档。) https://github.com/leehambley/capistrano-handbook/blob/master/index.markdown  http://weblog.jamisbuck.org/2007/5/11/capistrano-2-0-preview-2

after 'deploy:update_code' do
 #etc
end

看起来你必须完全确定任务名称。