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

Changeset 2729

Show
Ignore:
Timestamp:
10/25/05 16:34:00 (3 years ago)
Author:
david
Message:

Use an ENV command to find the executables -- makes it easier to run by SVN or CRON or something else on FreeBSD systems (and probably most nixes too)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • plugins/continuous_builder/lib/continuous_builder.rb

    r2728 r2729  
    11module ContinuousBuilder 
    22  class Build 
    3     attr_reader :status, :output, :success, :task_name 
     3    attr_reader :status, :output, :success, :options 
    44  
    55    def self.run 
     
    77    end 
    88  
    9     def initialize(task_name = ""
    10       @task_name = task_name 
     9    def initialize(options = {}
     10      @options = options 
    1111    end 
    1212  
     
    2525  
    2626    def commit_message 
    27       `svn log #{RAILS_ROOT} -rHEAD -v` 
     27      `#{options[:env_command]} svn log #{RAILS_ROOT} -rHEAD -v` 
    2828    end 
    2929  
     
    4444    private 
    4545      def update 
    46         @status = `svn update #{RAILS_ROOT}` 
     46        @status = `#{options[:env_command]} svn update #{RAILS_ROOT}` 
    4747      end 
    4848  
    4949      def info 
    50         @info ||= YAML.load(`svn info #{RAILS_ROOT}`) 
     50        @info ||= YAML.load(`#{options[:env_command]} svn info #{RAILS_ROOT}`) 
    5151      end 
    5252  
    5353      def make 
    54         @output, @success = `cd #{RAILS_ROOT} && RAILS_ENV=test rake #{task_name}`, ($?.exitstatus == 0) 
     54        @output, @success = `cd #{RAILS_ROOT} && RAILS_ENV=test #{options[:env_command]} rake #{options[:task_name]}`, ($?.exitstatus == 0) 
    5555      end 
    5656  end 
     
    5858  class Notifier < ActionMailer::Base 
    5959    def failure(build, application, email_to, email_from, sent_at = Time.now) 
    60       @subject    = "[#{application}] Build Failure (##{build.revision})" 
     60      @subject = "[#{application}] Build Failure (##{build.revision})" 
     61      @body    = [ "#{build.author} broke the build!", build.commit_message, build.output ].join("\n\n") 
    6162      @recipients, @from, @sent_on = email_to, email_from, sent_at 
    62       @body       = ["#{build.author} broke the build!", 
    63                      build.commit_message, 
    64                      build.output].join("\n\n") 
    6563    end 
    6664  end 
  • plugins/continuous_builder/tasks/test_build.rake

    r2728 r2729  
    33  require(File.dirname(__FILE__) + "/../lib/continuous_builder") 
    44 
    5   build = ContinuousBuilder::Build.new(ENV['RAKE_TASK']  || '') 
     5  build = ContinuousBuilder::Build.new( 
     6    :task_name   => ENV['RAKE_TASK']   || '', 
     7    :env_command => ENV['ENV_COMMAND'] || "/usr/bin/env" 
     8  ) 
    69  
    710  if build.has_changes? && !build.tests_ok?