I am using Capistrano v2.14.2
and trying to use the before
and after
hooks for deploy:create_symlink
, but none of them seem to firing...
I was getting this Warning:
[Deprecation Warning] This API has changed, please hook 'deploy:create_symlink' instead of 'deploy:symlink'.
So I updated my code to use deploy:create_symlink
instead of deploy:symlink
Here is a snipplet of my 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")
Here is a snipplet of the output:
* 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
No hooks are called...
Hooks for deploy:finalize_update
and deploy:update_code
all seem to be working without any issue.
What has happened to being able to use before
and after
hooks for deploy:create_symlink
?
I'm running into a similar issue, using the same version of Capistrano. I'm also using capistrano-multistage, and I'm curious if that is causing the issue some how (haven't tested a plain Capistrano setup yet).
Basically, if you hook into a before/after trigger on deploy:symlink, it tells you to use deploy:create_symlink, but deploy:symlink is what actually runs. If I trigger on either of those, it doesn't fire.
I ran across this article, which got me thinking that i should trigger on "after deploy" instead, since symlink is the last step in deploy for me:
http://blog.rememberlenny.com/2013/03/04/deploying-wordpress-with-capistrano-symlink-issue-fix/
Here is how I resolved my deployment:
change
"after deploy:symlink"
to
"after deploy"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With