ssp-cijoe 0.4.1 → 0.4.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/lib/cijoe/build.rb CHANGED
@@ -41,12 +41,20 @@ class CIJoe
41
41
  "#{short_sha}.#{finished_at.to_i.to_s}"
42
42
  end
43
43
 
44
+ def metrics_dir
45
+ "#{Config.cijoe.metricsdir}/#{project}/#{full_id}"
46
+ end
47
+
48
+ def coverage_dir
49
+ "#{Config.cijoe.coveragedir}/#{project}/#{full_id}"
50
+ end
51
+
44
52
  def metrics_url
45
- "#{Config.cijoe.metricshost}/#{full_id}/metrics/index.html"
53
+ "http://ci.secretsaucepartners.com/metrics/#{project}/#{full_id}/index.html"
46
54
  end
47
55
 
48
56
  def coverage_url
49
- "#{Config.cijoe.metricshost}/#{full_id}/coverage/index.html"
57
+ "http://ci.secretsaucepartners.com/coverage/#{project}/#{full_id}/index.html"
50
58
  end
51
59
 
52
60
  def clean_output
@@ -16,7 +16,7 @@ html, body {
16
16
  }
17
17
 
18
18
  body {
19
- background-color: white;
19
+ background-color: #f0f0f0;
20
20
  font: 13.34px helvetica, arial, clean, sans-serif;
21
21
  *font-size: small;
22
22
  text-align: center;
@@ -26,25 +26,72 @@ h1, h2, h3, h4, h5, h6 {
26
26
  font-size: 100%;
27
27
  }
28
28
 
29
- h1 {
29
+ h1, h2 {
30
30
  margin-bottom: 1em;
31
+ height: 34px;
31
32
  }
32
33
 
33
- h1 a {
34
+ h1 a, h2 a {
35
+ font-size: 24px;
36
+ background: white;
37
+ padding: 6px 10px;
34
38
  text-decoration: none;
35
- color: #000;
39
+ color: #e61e4e;
40
+ display: block;
41
+ float: left;
42
+ }
43
+
44
+ h2 a {
45
+ margin-right: 10px;
46
+ }
47
+
48
+ h1 span.build form {
49
+ display: inline;
50
+ }
51
+
52
+ h2 span {
53
+ display: block;
54
+ line-height: 30px;
55
+ color: #999;
56
+ padding: 6px 0 0 10px;
57
+ }
58
+
59
+ h1 span.build form input {
60
+ font-size: 24px;
61
+ background: #aab2ac;
62
+ height: 34px;
63
+ padding: 0 10px;
64
+ color: white;
65
+ border: 1px solid #8c938e;
66
+ margin-left: 10px;
67
+ }
68
+
69
+ h1 span.build form input:hover {
70
+ background: #8c938e;
71
+ }
72
+
73
+ .current {
74
+ clear: both;
75
+ margin: 18px 0;
76
+ }
77
+
78
+ .failed, .worked, .errored {
79
+ color: white !important;
80
+ font-size: 11px;
81
+ padding: 2px 5px;
82
+ font-weight: bold;
36
83
  }
37
84
 
38
85
  .failed, .color31 {
39
- color: red !important;
86
+ background: red;
40
87
  }
41
88
 
42
89
  .worked, .color32 {
43
- color: green !important;
90
+ background: green;
44
91
  }
45
92
 
46
93
  .errored, .color33 {
47
- color: yellow !important;
94
+ background: yellow;
48
95
  }
49
96
 
50
97
  p {
@@ -77,18 +124,37 @@ table {
77
124
  ul.posts {
78
125
  list-style-type: none;
79
126
  margin-bottom: 2em;
127
+ clear: both;
80
128
  }
81
129
 
82
130
  ul.posts li {
83
131
  line-height: 1.75em;
132
+ margin-bottom: 18px;
84
133
  }
85
-
134
+
86
135
  ul.posts .date,
87
136
  ul.posts .duration {
88
137
  color: #aaa;
89
138
  font-family: Monaco, "Courier New", monospace;
90
139
  font-size: 80%;
91
140
  }
141
+
142
+ ul.posts span.metrics {
143
+ margin-left: 20px;
144
+ line-height: 18px;
145
+ font-size: 11px;
146
+ }
147
+
148
+ ul.posts span.metrics a {
149
+ color: #e61e4e;
150
+ background: #fff;
151
+ padding: 2px 5px;
152
+ }
153
+
154
+ ul.posts span.metrics a:hover {
155
+ background: #e61e4e;
156
+ color: #fff;
157
+ }
92
158
 
93
159
  /*****************************************************************************/
94
160
  /*
data/lib/cijoe/server.rb CHANGED
@@ -49,6 +49,10 @@ class CIJoe
49
49
  include Rack::Utils
50
50
  alias_method :h, :escape_html
51
51
 
52
+ def logger
53
+ LOGGER
54
+ end
55
+
52
56
  # thanks integrity!
53
57
  def ansi_color_codes(string)
54
58
  string.gsub("\e[0m", '</span>').
data/lib/cijoe/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  class CIJoe
2
- Version = "0.4.1"
2
+ Version = "0.4.3"
3
3
  end
@@ -1,12 +1,9 @@
1
1
  <li>
2
- <span class="date"><%= pretty_time(build.finished_at) %></span> &raquo; Built <a href="<%= build.commit.url %>"><%= build.short_sha %></a> <span class="<%= build.status %>">(<%= build.status %>)</span>
3
- <span class="metrics">
4
- [ <a href="<%= build.metrics_url %>">Metrics</a> ]
5
- </span>
6
- <span class="coverage">
7
- [ <a href="<%= build.coverage_url %>">Coverage</a> ]
8
- </span>
2
+ <span class="date"><%= pretty_time(build.finished_at) %></span> &raquo; <span class="<%= build.status %>"><%= build.status %></span> &raquo; Built <a href="<%= build.commit.url %>"><%= build.short_sha %></a>
9
3
  <% if build.duration %>
10
4
  in <span class="duration"><%= build.duration %></span> seconds.
11
5
  <% end %>
6
+ <span class="metrics">
7
+ <a class="metrics" href="<%= build.metrics_url %>">Metrics</a> <a class="coverage" href="<%= build.coverage_url %>">Coverage</a>
8
+ </span>
12
9
  </li>
@@ -3,31 +3,29 @@
3
3
  <head>
4
4
  <link href="<%= cijoe_root %>/screen.css" media="screen" rel="stylesheet" type="text/css" />
5
5
  <link rel="shortcut icon" href="<%= cijoe_root %>/favicon.ico" type="image/x-icon" />
6
- <title><%= h(joe.project) %>: CI Joe</title>
6
+ <title><%= h(joe.project) %>: SSP Joe</title>
7
7
  </head>
8
8
  <body>
9
9
  <div class="site">
10
- <div class="title">
11
- <a href="<%= cijoe_root %>/">CI Joe</a>
12
- <span class="extra">because knowing is half the battle</span>
13
- </div>
14
-
15
10
  <div id="home">
16
- <h1><a href="<%= joe.url %>"><%= joe.project %></a></h1>
11
+ <h1>
12
+ <a href="<%= joe.url %>"><%= joe.project %></a>
13
+ <span class="build">
14
+ <% unless joe.current_build %>
15
+ <form method="POST"><input type="submit" value="&raquo; Build"/></form>
16
+ <% end %>
17
+ </span>
18
+ </h1>
19
+ <% if joe.current_build %>
20
+ <div class="current">
21
+ <% if joe.current_build.sha %>
22
+ Building <a href="<%= joe.current_build.commit.url %>"><%= joe.current_build.short_sha %></a> <small>(pid: <%= joe.pid %>)</small>
23
+ <% else %>
24
+ Build starting...
25
+ <% end %>
26
+ </div>
27
+ <% end %>
17
28
  <ul class="posts">
18
- <% if joe.current_build %>
19
- <li>
20
- <span class="date"><%= pretty_time(joe.current_build.started_at) if joe.current_build %></span> &raquo;
21
- <% if joe.current_build.sha %>
22
- Building <a href="<%= joe.current_build.commit.url %>"><%= joe.current_build.short_sha %></a> <small>(pid: <%= joe.pid %>)</small>
23
- <% else %>
24
- Build starting...
25
- <% end %>
26
- </li>
27
- <% else %>
28
- <li><form method="POST"><input type="submit" value="Build"/></form></li>
29
- <% end %>
30
-
31
29
  <% if joe.last_build %>
32
30
  <%= partial :build, :locals => {:build => joe.last_build} %>
33
31
  <% if joe.last_build.failed? %>
@@ -37,7 +35,7 @@
37
35
  </ul>
38
36
 
39
37
  <% unless joe.build_history.empty? %>
40
- <h1><a href="<%= joe.url %>"><%= joe.project %></a> <span style="color: #999;">build history</span></h1>
38
+ <h2><a href="<%= joe.url %>"><%= joe.project %></a> <span style="color: #999;">build history</span></h2>
41
39
  <ul class="posts">
42
40
  <% joe.build_history.each do |current_build| %>
43
41
  <%= partial :build, :locals => {:build => current_build} %>
data/lib/cijoe.rb CHANGED
@@ -19,6 +19,7 @@ require 'cijoe/commit'
19
19
  require 'cijoe/build'
20
20
  require 'cijoe/campfire'
21
21
  require 'cijoe/server'
22
+ require 'fileutils'
22
23
 
23
24
  class CIJoe
24
25
 
@@ -149,6 +150,19 @@ class CIJoe
149
150
  rescue Object => e
150
151
  puts "Exception building: #{e.message} (#{e.class})"
151
152
  build_failed('', e.to_s)
153
+ else
154
+ publish_metrics_and_coverage(build)
155
+ end
156
+
157
+ def publish_metrics_and_coverage(build)
158
+ puts "Creating metrics dir ..."
159
+ `mkdir #{build.metrics_dir}`
160
+ puts "Creating coverage dir ..."
161
+ `mkdir #{build.coverage_dir}`
162
+ puts "Publishing coverage ..."
163
+ `cp -r coverage/* #{build.coverage_dir}`
164
+ puts "Publishing metrics ..."
165
+ `cp -r tmp/metric_fu/output/* #{build.metrics_dir}`
152
166
  end
153
167
 
154
168
  # shellin' out
@@ -232,6 +246,6 @@ class CIJoe
232
246
  history = build_entries.inject([]) do |builds, entry|
233
247
  builds << read_build(entry)
234
248
  end
235
- history
249
+ history.sort { |b,a| a.finished_at <=> b.finished_at }
236
250
  end
237
251
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ssp-cijoe
3
3
  version: !ruby/object:Gem::Version
4
- hash: 13
4
+ hash: 9
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 4
9
- - 1
10
- version: 0.4.1
9
+ - 3
10
+ version: 0.4.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Chris Wanstrath
@@ -17,7 +17,7 @@ autorequire:
17
17
  bindir: bin
18
18
  cert_chain: []
19
19
 
20
- date: 2010-06-03 00:00:00 +02:00
20
+ date: 2010-06-10 00:00:00 +02:00
21
21
  default_executable: cijoe
22
22
  dependencies:
23
23
  - !ruby/object:Gem::Dependency