build-buddy 1.8.0 → 1.8.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bc533f6854862178451a21df0a4d84ae2061990b
4
- data.tar.gz: be19e66a1a5dee3caf7dc857cf8960582331775a
3
+ metadata.gz: 656443f17239c6954ec716ef56dce64a6ad0a33b
4
+ data.tar.gz: bf937f8268594356e0bfc79bcbb6163a4134e386
5
5
  SHA512:
6
- metadata.gz: 462ec0136b74bafc5a3a93f8c1914ad1f6b39a2a7a90b34fdea196ee180e57e3a7c63a3e4b42762881cc791fea3c773da9f72e5e43600afd247abdd3199b5883
7
- data.tar.gz: 8ba1d443cc60f29858b6dc5fa27b358c7d4b74a119ea46b1939a31afff428bc446d5c7345ff25cba07416974619c843ab84a3a165efe5c5e886f27741904df54
6
+ metadata.gz: a04a74c2e86297a87a5f0ec98ede406e05456073479d661edd298c90df868ffc896b5b1aa4078f7e8858a2df6d5d3286434c8e60f9eacfcb3ab80db5af269994
7
+ data.tar.gz: 0f45e9e4bb55b51107369dad1555f3074dd6b04273c24721f72cf8b12b7c4b55cc089bb0174f85c7cf8b0f098c26dbc8e364d1fb9a676dff23eca3702820b1a8
data/lib/build_buddy.rb CHANGED
@@ -9,5 +9,5 @@ require 'build_buddy/recorder'
9
9
  require 'build_buddy/build_data'
10
10
 
11
11
  module BuildBuddy
12
- VERSION = "1.8.0"
12
+ VERSION = "1.8.4"
13
13
  end
@@ -14,7 +14,7 @@ module BuildBuddy
14
14
  info "Connected to Github"
15
15
  end
16
16
 
17
- def set_status(repo_full_name, repo_sha, status, description, target_url)
17
+ def set_status(repo_full_name, repo_sha, state, description, target_url)
18
18
  options = {
19
19
  :description => description.length > 140 ? "#{description[0..136]}..." : description,
20
20
  :context => 'build-buddy'
@@ -22,7 +22,7 @@ module BuildBuddy
22
22
  unless target_url.nil?
23
23
  options[:target_url] = target_url
24
24
  end
25
- @gh_client.create_status(repo_full_name, repo_sha, status.to_s, options)
25
+ @gh_client.create_status(repo_full_name, repo_sha, state.to_s, options)
26
26
  end
27
27
  end
28
28
  end
@@ -27,8 +27,8 @@ module BuildBuddy
27
27
  request.respond 500, "Signatures didn't match!"
28
28
  else
29
29
  payload = JSON.parse(payload_text)
30
+ action = payload['action']
30
31
  pull_request = payload['pull_request']
31
- pull_request_action = pull_request['action']
32
32
 
33
33
  case action
34
34
  when 'opened', 'reopened', 'synchronize'
@@ -269,15 +269,15 @@ Ask me `what happened` to get a list of recent builds and log files and `what op
269
269
  def notify_channel(build_data)
270
270
  status_message = build_data.termination_type == :killed ? "was stopped" : build_data.exit_code != 0 ? "failed" : "succeeded"
271
271
  status_message += '. '
272
+ log_url = Config.server_base_uri + '/log/' + build_data._id.to_s
272
273
 
273
274
  if build_data.type == :pull_request
274
- message = "The buddy build #{status_message}"
275
- git_status = (build_data.termination_type == :killed ? :failure : build_data.exit_code != 0 ? :error : :success)
276
- git_url = (git_status == :error ? "#{Config.server_base_uri + '/log/' + build_data._id.to_s}" : nil)
277
- Celluloid::Actor[:gitter].async.set_status(build_data.repo_full_name, build_data.repo_sha, git_status, git_message, git_url)
275
+ message = "Build #{status_message}"
276
+ git_state = (build_data.termination_type == :killed ? :failure : build_data.exit_code != 0 ? :error : :success)
277
+ Celluloid::Actor[:gitter].async.set_status(build_data.repo_full_name, build_data.repo_sha, git_state, message, log_url)
278
278
  info "Pull request build #{status_message}"
279
279
  else
280
- status_message += "Log file at #{Config.server_base_uri + '/log/' + build_data._id.to_s}."
280
+ status_message += "Log file at #{log_url}."
281
281
  if build_data.type == :master
282
282
  message = "A build of the `master` branch #{status_message}"
283
283
  info "`master` branch build #{status_message}"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: build-buddy
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.8.0
4
+ version: 1.8.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Lyon-smith
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-04-08 00:00:00.000000000 Z
11
+ date: 2016-04-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: timers