Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #9356 (closed defect: fixed)

Opened 1 year ago

Last modified 1 year ago

triggering the before hook in Capistrano

Reported by: steveodom Assigned to: minam
Priority: normal Milestone: 1.x
Component: Capistrano Version: edge
Severity: normal Keywords:
Cc:

Description

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"

Change History

08/31/07 05:29:11 changed by minam

  • status changed from new to closed.
  • resolution set to fixed.

(In [7381]) Don't let a task trigger itself when used as the source for an on hook (closes #9356)