Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/cmw/cijoe into cmw-master
Browse files Browse the repository at this point in the history
Conflicts:
	lib/cijoe/version.rb
  • Loading branch information
defunkt committed Feb 8, 2011
2 parents 23f2045 + b8826b7 commit 3d3cf6b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion lib/cijoe.rb
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions 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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions lib/cijoe/views/template.erb
Expand Up @@ -19,7 +19,7 @@
<li>
<span class="date"><%= pretty_time(joe.current_build.started_at) if joe.current_build %></span> &raquo;
<% if joe.current_build.sha %>
Building <a href="<%= joe.current_build.commit.url %>"><%= joe.current_build.short_sha %></a> <small>(pid: <%= joe.pid %>)</small>
Building <%= joe.current_build.branch %> at <a href="<%= joe.current_build.commit.url %>"><%= joe.current_build.short_sha %></a> <small>(pid: <%= joe.pid %>)</small>
<% else %>
Build starting...
<% end %>
Expand All @@ -32,7 +32,7 @@
<li>
<span class="date"><%= pretty_time(joe.last_build.finished_at) %></span> &raquo;
<% if joe.last_build.sha %>
Built <a href="<%= joe.last_build.commit.url %>"><%= joe.last_build.short_sha %></a>
Built <%= joe.last_build.branch %> at <a href="<%= joe.last_build.commit.url %>"><%= joe.last_build.short_sha %></a>
<% end %>
<span class="<%= joe.last_build.status %>">(<%= joe.last_build.status %>)</span>
<% if joe.last_build.duration %>
Expand Down

0 comments on commit 3d3cf6b

Please sign in to comment.