我正在使用Capistrano v2.14.2
并尝试使用before
andafter
钩子deploy:create_symlink
,但它们似乎都没有触发......
我收到了这个警告:
[Deprecation Warning] This API has changed, please hook 'deploy:create_symlink' instead of 'deploy:symlink'.
所以我更新了我的代码以使用deploy:create_symlink
而不是deploy:symlink
这是我的一个片段deploy.rb
namespace :foo do
task :start do
puts "starting foo..."
end
task :stop do
puts "stoping foo..."
end
end
before('deploy:create_symlink', "foo:stop")
after('deploy:create_symlink', "foo:start")
这是输出的片段:
* 2013-04-04 13:34:27 executing `deploy:symlink'
* executing "rm -f /web/example.com/current && ln -s /web/example.com/releases/20130404203425 /web/example.com/current"
servers: ["app1"]
[app1] executing command
command finished in 467ms
没有钩子被称为...
Hooks for deploy:finalize_update
and deploy:update_code
all 似乎都在正常工作,没有任何问题。
能够使用before
和after
钩子发生了deploy:create_symlink
什么?