I'm trying to run a task before every other task in a Capistrano namespace.
Something like:
namespace :ec2 do
desc "initialize the AWS variable"
task :aws do
puts "i was called"
end
desc "return the our amazon images."
task :images do
puts "before me"
end
on :before, "ec2:aws"
end
The "on :before, "ec2:aws" is not working. The before hook seems to be triggered before executing "ec2:aws". It generates lots of "
triggering before callbacks for `ec2:aws'" listed and a "stack level
too deep (SystemStackError)".
A workaround is to call the before hook like:
on :before, "ec2:aws", :except => "ec2:aws"