ssp-cijoe 0.4.4.2 → 0.4.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.rb CHANGED
@@ -22,7 +22,7 @@ require 'cijoe/server'
22
22
  require 'fileutils'
23
23
 
24
24
  class CIJoe
25
-
25
+
26
26
  attr_reader :user, :project, :url, :current_build, :last_build
27
27
 
28
28
  def initialize(project_path)
@@ -78,7 +78,7 @@ class CIJoe
78
78
  @last_build = @current_build
79
79
 
80
80
  @current_build = nil
81
-
81
+
82
82
  actual_build_id = "#{@last_build.commit.sha[0..7]}.#{Time.now.to_i}.build"
83
83
  write_build actual_build_id, @last_build
84
84
  write_build 'current', @current_build
@@ -150,8 +150,10 @@ class CIJoe
150
150
  rescue Object => e
151
151
  puts "Exception building: #{e.message} (#{e.class})"
152
152
  build_failed('', e.to_s)
153
+ publish_screenshots(build)
153
154
  else
154
155
  publish_metrics_and_coverage(build)
156
+ publish_screenshots(build)
155
157
  end
156
158
 
157
159
  def publish_metrics_and_coverage(build)
@@ -165,6 +167,13 @@ class CIJoe
165
167
  `cp -r tmp/metric_fu/output/* #{build.metrics_dir}`
166
168
  end
167
169
 
170
+ def publish_screenshots(build)
171
+ puts "Creating screenshots dir ..."
172
+ `mkdir #{build.screenshots_dir}`
173
+ puts "Publishing screenshots ..."
174
+ `cp screenshots/* #{build.screenshots_dir}`
175
+ end
176
+
168
177
  # shellin' out
169
178
  def runner_command
170
179
  runner = Config.cijoe.runner.to_s
@@ -240,7 +249,7 @@ class CIJoe
240
249
  def read_build(name)
241
250
  Build.load(".git/builds/#{name}")
242
251
  end
243
-
252
+
244
253
  def build_history
245
254
  build_entries = Dir.open(".git/builds").entries.select { |dir| dir.match /^([a-z0-9]{8})\.([\d]{10})\.build$/ }
246
255
  history = build_entries.inject([]) do |builds, entry|
data/lib/cijoe/build.rb CHANGED
@@ -49,6 +49,10 @@ class CIJoe
49
49
  "#{Config.cijoe.coveragedir}/#{project}/#{full_id}"
50
50
  end
51
51
 
52
+ def screenshots_dir
53
+ "#{Config.cijoe.screenshotsdir}/#{project}/#{full_id}"
54
+ end
55
+
52
56
  def metrics_url
53
57
  "/metrics/#{project}/#{full_id}/index.html"
54
58
  end
@@ -57,6 +61,10 @@ class CIJoe
57
61
  "/coverage/#{project}/#{full_id}/index.html"
58
62
  end
59
63
 
64
+ def screenshots_url
65
+ "/screenshots/#{project}/#{full_id}/"
66
+ end
67
+
60
68
  def clean_output
61
69
  output.gsub(/\e\[.+?m/, '').strip
62
70
  end
@@ -131,27 +131,27 @@ ul.posts {
131
131
  line-height: 1.75em;
132
132
  margin-bottom: 18px;
133
133
  }
134
-
134
+
135
135
  ul.posts .date,
136
136
  ul.posts .duration {
137
137
  color: #aaa;
138
138
  font-family: Monaco, "Courier New", monospace;
139
139
  font-size: 80%;
140
140
  }
141
-
142
- ul.posts span.metrics {
141
+
142
+ ul.posts span.links {
143
143
  margin-left: 20px;
144
144
  line-height: 18px;
145
145
  font-size: 11px;
146
146
  }
147
147
 
148
- ul.posts span.metrics a {
148
+ ul.posts span.links a {
149
149
  color: #e61e4e;
150
150
  background: #fff;
151
151
  padding: 2px 5px;
152
152
  }
153
-
154
- ul.posts span.metrics a:hover {
153
+
154
+ ul.posts span.links a:hover {
155
155
  background: #e61e4e;
156
156
  color: #fff;
157
157
  }
@@ -1,9 +1,12 @@
1
1
  <li>
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>
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>
3
3
  <% if build.duration %>
4
4
  in <span class="duration"><%= build.duration %></span> seconds.
5
5
  <% end %>
6
- <span class="metrics">
6
+ <span class="links">
7
7
  <a class="metrics" href="<%= build.metrics_url %>">Metrics</a> <a class="coverage" href="<%= build.coverage_url %>">Coverage</a>
8
8
  </span>
9
+ <span class="links">
10
+ <a class="screenshots" href="<%= build.screenshots_url %>">Screenshots</a>
11
+ </span>
9
12
  </li>
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ssp-cijoe
3
3
  version: !ruby/object:Gem::Version
4
- hash: 123
4
+ hash: 121
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 4
9
9
  - 4
10
- - 2
11
- version: 0.4.4.2
10
+ - 3
11
+ version: 0.4.4.3
12
12
  platform: ruby
13
13
  authors:
14
14
  - Chris Wanstrath