Module | Capistrano::Configuration::Callbacks |
In: |
lib/capistrano/configuration/callbacks.rb
|
callbacks | [R] | The hash of callbacks that have been registered for this configuration |
Defines a callback to be invoked after the given task. You must specify the fully-qualified task name, both for the primary task, and for the task(s) to be executed after. Alternatively, you can pass a block to be executed after the given task.
after "deploy:update_code", :log_difference after :deploy, "custom:announce" after :deploy, :this, "then:this", "and:then:this" after :some_task do puts "an anonymous hook!" end
This just provides a convenient interface to the more general on method.
Defines a callback to be invoked before the given task. You must specify the fully-qualified task name, both for the primary task, and for the task(s) to be executed before. Alternatively, you can pass a block to be executed before the given task.
before "deploy:update_code", :record_difference before :deploy, "custom:log_deploy" before :deploy, :this, "then:this", "and:then:this" before :some_task do puts "an anonymous hook!" end
This just provides a convenient interface to the more general on method.
Defines one or more callbacks to be invoked in response to some event. Capistrano currently understands the following events:
Specify the (fully-qualified) task names that you want invoked in response to the event. Alternatively, you can specify a block to invoke when the event is triggered. You can also pass a hash of options as the last parameter, which may include either of two keys:
Usage:
on :before, "some:hook", "another:hook", :only => "deploy:update" on :after, "some:hook", :except => "deploy:create_symlink" on :before, "global:hook" on :after, :only => :deploy do puts "after deploy here" end