[Cruisecontrolrb-users] Environment issues when using custom rake build task

Christos Zisopoulos christos at 42linesofcode.com
Wed May 23 09:18:06 EDT 2007


Hi there,

When using a custom rake_task or when defining the default 'cruise'  
task in my Rakefile I get into a peculiar situation. The rake task  
runs in the 'test' environment which I define for most of the part,  
but not always...

If I have a task that depends on "test:db:prepare" then for some  
weird reason the test:db:prepare" is executed in 'production' or  
whatever environment cruisecontroll is running in. I think I traced  
it down to the fact that at the end "test:db:prepare" depends on the  
default :environment Rake task which reads:

task :environment do
   require(File.join(RAILS_ROOT, 'config', 'environment'))
end

This is what my custom task looks like

task :cruise => "test:db:prepare"
   # Do whatever here should first invoke test:db:prepare
end

Any ideas what might be the problem?

Cheers!
-christos


More information about the Cruisecontrolrb-users mailing list