Skip to content
Browse files

Oops, need to pass the build to campfire when we notify. Just did a p…

…roduction test.
  • Loading branch information...
1 parent 3ffcbbd commit 02d4ef6c6e6005a4614ca2f99c8aaff62d43980c @queso queso committed Feb 21, 2011
Showing with 13 additions and 12 deletions.
  1. +1 −1 lib/cijoe.rb
  2. +11 −10 lib/cijoe/campfire.rb
  3. +1 −1 lib/cijoe/version.rb
View
2 lib/cijoe.rb
@@ -79,7 +79,7 @@ def finish_build(status, output)
@current_build = nil
write_build 'current', @current_build
write_build 'last', @last_build
- @campfire.notify if @campfire.valid?
+ @campfire.notify(@last_build) if @campfire.valid?
# another build waits
if !repo_config.buildallfile.to_s.empty? && File.exist?(repo_config.buildallfile.to_s)
View
21 lib/cijoe/campfire.rb
@@ -1,6 +1,6 @@
class CIJoe
class Campfire
- attr_reader :project_path
+ attr_reader :project_path, :build
def initialize(project_path)
@project_path = project_path
@@ -34,10 +34,11 @@ def valid?
end
end
- def notify
+ def notify(build)
begin
- room.speak "#{short_message}. #{commit.url}"
- room.paste full_message if failed?
+ @build = build
+ room.speak "#{short_message}. #{build.commit.url}"
+ room.paste full_message if build.failed?
room.leave
rescue
puts "Please check your campfire config for #{project_path}."
@@ -56,17 +57,17 @@ def room
end
def short_message
- "#{branch} at #{short_sha} of #{project} " +
- (worked? ? "passed" : "failed") + " (#{duration.to_i}s)"
+ "#{build.branch} at #{build.short_sha} of #{build.project} " +
+ (build.worked? ? "passed" : "failed") + " (#{build.duration.to_i}s)"
end
def full_message
<<-EOM
-Commit Message: #{commit.message}
-Commit Date: #{commit.committed_at}
-Commit Author: #{commit.author}
+Commit Message: #{build.commit.message}
+Commit Date: #{build.commit.committed_at}
+Commit Author: #{build.commit.author}
-#{clean_output}
+#{build.clean_output}
EOM
end
end
View
2 lib/cijoe/version.rb
@@ -1,3 +1,3 @@
class CIJoe
- Version = VERSION = "0.9.1"
+ Version = VERSION = "0.9.2"
end

0 comments on commit 02d4ef6

Please sign in to comment.
Something went wrong with that request. Please try again.