On Tue, Sep 28, 2010 at 12:55 PM, Todd Sedano <todd.sed...@sv.cmu.edu> wrote: > Chad, > I wanted to make sure that I understood your suggestion. I tried to call > bundler through a systems call using the "back tick" or `bundle install` > (see below) but that didn't work. > I believe the main issue is that I need to run bundle install before any of > the rake files are executed or call my rake file with "bundle exec rake > ..." > I'm hoping you can point me in the right direction in the code to make > either modification. Maybe the easiest thing to do is to set > project.build_command to a shell script. Other than bundle install, what > would I put in my shell script to get cruise control to execute what it > currently does? (I'm guessing it is a call to cc_build.rake with some > arguments.) > > lib/tasks/cruise.rake > require 'rubygems' > require 'rake' > require 'fileutils' > require 'bundler' > desc "Task for cruise Control" > task :cruise do > RAILS_ENV = ENV['RAILS_ENV'] = 'test' > `bundle install` > Bundler.setup(:default, :test) > ... > end
Yeah, like I said I'm kinda vague on this. But you DON'T necessarily need to run bundle install BEFORE cruise.rake executes, but you DO need to run it before rails loads the environment (which happens when you run a rails rake task. So what you have may be ok, if the '...' turns into something like "system('rake default') or raise 'rake failed'" I THINK that in rails 2.x, calling bundle install from preinitializer.rb (which runs before environment actually loads) should accomplish the same thing - even though it gets run twice (a quirk of rails 2.x init). Again, I'm almost positive there's some good rails 2.x + bundler docs on the bundler site which are relevant to the latest 1.x bundler release, including what you need to stick in preinitializer.rb. And the bundler list is a better place to ask this stuff (and please feel free to follow up here with a definitive answer). Good luck, -- Chad _______________________________________________ Cruisecontrolrb-users mailing list Cruisecontrolrb-users@rubyforge.org http://rubyforge.org/mailman/listinfo/cruisecontrolrb-users