diff --git a/lib/cijoe.rb b/lib/cijoe.rb index 79f2577..6d9e615 100644 --- a/lib/cijoe.rb +++ b/lib/cijoe.rb @@ -127,10 +127,11 @@ def build!(branch=nil) output = '' git_update build.sha = git_sha + build.branch = git_branch write_build 'current', build open_pipe("cd #{@project_path} && #{runner_command} 2>&1") do |pipe, pid| - puts "#{Time.now.to_i}: Building #{build.short_sha}: pid=#{pid}" + puts "#{Time.now.to_i}: Building #{build.branch} at #{build.short_sha}: pid=#{pid}" build.pid = pid write_build 'current', build diff --git a/lib/cijoe/build.rb b/lib/cijoe/build.rb index 654741e..5276be9 100644 --- a/lib/cijoe/build.rb +++ b/lib/cijoe/build.rb @@ -1,7 +1,7 @@ require 'yaml' class CIJoe - class Build < Struct.new(:project_path, :user, :project, :started_at, :finished_at, :sha, :status, :output, :pid) + class Build < Struct.new(:project_path, :user, :project, :started_at, :finished_at, :sha, :status, :output, :pid, :branch) def initialize(*args) super self.started_at ||= Time.now @@ -52,7 +52,7 @@ def commit end def dump(file) - config = [user, project, started_at, finished_at, sha, status, output, pid] + config = [user, project, started_at, finished_at, sha, status, output, pid, branch] data = YAML.dump(config) File.open(file, 'wb') { |io| io.write(data) } end diff --git a/lib/cijoe/views/template.erb b/lib/cijoe/views/template.erb index 3dc4ffb..bb7c12f 100644 --- a/lib/cijoe/views/template.erb +++ b/lib/cijoe/views/template.erb @@ -19,7 +19,7 @@
  • <%= pretty_time(joe.current_build.started_at) if joe.current_build %> » <% if joe.current_build.sha %> - Building <%= joe.current_build.short_sha %> (pid: <%= joe.pid %>) + Building <%= joe.current_build.branch %> at <%= joe.current_build.short_sha %> (pid: <%= joe.pid %>) <% else %> Build starting... <% end %> @@ -32,7 +32,7 @@
  • <%= pretty_time(joe.last_build.finished_at) %> » <% if joe.last_build.sha %> - Built <%= joe.last_build.short_sha %> + Built <%= joe.last_build.branch %> at <%= joe.last_build.short_sha %> <% end %> (<%= joe.last_build.status %>) <% if joe.last_build.duration %>