Changeset 2729
- Timestamp:
- 10/25/05 16:34:00 (3 years ago)
- Files:
-
- plugins/continuous_builder/lib/continuous_builder.rb (modified) (5 diffs)
- plugins/continuous_builder/tasks/test_build.rake (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
plugins/continuous_builder/lib/continuous_builder.rb
r2728 r2729 1 1 module ContinuousBuilder 2 2 class Build 3 attr_reader :status, :output, :success, : task_name3 attr_reader :status, :output, :success, :options 4 4 5 5 def self.run … … 7 7 end 8 8 9 def initialize( task_name = "")10 @ task_name = task_name9 def initialize(options = {}) 10 @options = options 11 11 end 12 12 … … 25 25 26 26 def commit_message 27 ` svn log #{RAILS_ROOT} -rHEAD -v`27 `#{options[:env_command]} svn log #{RAILS_ROOT} -rHEAD -v` 28 28 end 29 29 … … 44 44 private 45 45 def update 46 @status = ` svn update #{RAILS_ROOT}`46 @status = `#{options[:env_command]} svn update #{RAILS_ROOT}` 47 47 end 48 48 49 49 def info 50 @info ||= YAML.load(` svn info #{RAILS_ROOT}`)50 @info ||= YAML.load(`#{options[:env_command]} svn info #{RAILS_ROOT}`) 51 51 end 52 52 53 53 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) 55 55 end 56 56 end … … 58 58 class Notifier < ActionMailer::Base 59 59 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") 61 62 @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")65 63 end 66 64 end plugins/continuous_builder/tasks/test_build.rake
r2728 r2729 3 3 require(File.dirname(__FILE__) + "/../lib/continuous_builder") 4 4 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 ) 6 9 7 10 if build.has_changes? && !build.tests_ok?