build-buddy 1.15.0 → 1.16.0

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: b047d2b1bc2a825a18ba63df01115b0f7564a965
4
- data.tar.gz: 02cfc587d188363d5e48aba4d7234e423498a129
3
+ metadata.gz: 71d3b93e2aa1cf310586d98a001ad1aeb8a9b6ae
4
+ data.tar.gz: 899ef4ca9076a751015a13bf1ce66990e53ba752
5
5
  SHA512:
6
- metadata.gz: 1fd06cea76d507a0e03d9248ae7f5f5d440071d9dcde85362d1736501634f32aa8b9c63049d287624a722af3a2898591e6bc74aba459038ab5caebb5a1d5adc5
7
- data.tar.gz: d68577afdc4f51a768265c85b671a1374aed7c3aed6bd7b70c34d85cce3d00510efc3e255c5dbf5d99c7ff9fd98713d339c717a9ca19cac57ed8b5c1b3e39e52
6
+ metadata.gz: 16965b5a8f3c9e5cf88e84fdd057f5649a2948b16c94cd854a3f7cdf2a42779f074aab6c5e4f3ee1714a99427ec8f06e551d987d271337c99d72992315ac722b
7
+ data.tar.gz: 5e702e6e2aab68fe65945e30d8e54503f7325be9226ac1c609ab0a10f342b4fe21e1e84c375c615d288f33e1407c8ed861ccd3c542c64d21316d324d6b70f311
@@ -9,5 +9,5 @@ require 'build_buddy/recorder'
9
9
  require 'build_buddy/build_data'
10
10
 
11
11
  module BuildBuddy
12
- VERSION = "1.15.0"
12
+ VERSION = "1.16.0"
13
13
  end
@@ -93,7 +93,8 @@ module BuildBuddy
93
93
 
94
94
  def run_time
95
95
  end_time = @end_time.nil? ? Time.now.utc : @end_time
96
- Time.at(end_time - @start_time).utc.strftime('%H:%M:%S.%L')
96
+ start_time = @start_time.nil? ? end_time : @start_time
97
+ Time.at(end_time - start_time).utc.strftime('%H:%M:%S.%L')
97
98
  end
98
99
  end
99
100
  end
@@ -123,7 +123,7 @@ source ${BB_BUILD_SCRIPT}
123
123
 
124
124
  unless build_data.flags.nil?
125
125
  build_data.flags.each do |flag|
126
- env["BB_BUILD_FLAG_#{flag.to_s.upcase}"] = 1
126
+ env["BB_BUILD_FLAG_#{flag.to_s.upcase}"] = '1'
127
127
  end
128
128
  end
129
129
 
@@ -41,7 +41,7 @@ module BuildBuddy
41
41
  flags = []
42
42
  unless message.nil?
43
43
  message.split(',').each do |s|
44
- flags.push(s.lstrip.rstrip.downcase.gsub(' ', '_').to_sym)
44
+ flags.push(s.lstrip.rstrip.gsub(' ', '_').to_sym)
45
45
  end
46
46
  end
47
47
  flags
@@ -61,20 +61,26 @@ module BuildBuddy
61
61
  message = message.strip
62
62
 
63
63
  case message
64
- when /^master(?: +with +(?<flags>[a-z ]+))?/i
64
+ when /^master(?: +with +(?<flags>[a-z ,]+))?/i
65
65
  flags = Slacker.extract_build_flags($~[:flags])
66
66
  response = "OK, I've queued a build of the `master` branch."
67
+ if flags.count > 0
68
+ response += " (#{flags.join(", ")})"
69
+ end
67
70
  scheduler.queue_a_build(BuildData.new(
68
71
  :type => :branch,
69
72
  :branch => 'master',
70
73
  :flags => flags,
71
74
  :repo_full_name => Config.github_webhook_repo_full_name,
72
75
  :started_by => slack_user_name))
73
- when /^(?<version>v\d+\.\d+)(?: with )?(?<flags>.*)?/
76
+ when /^(?<version>v\d+\.\d+)(?: +with +(?<flags>[a-z ,]+))?/
74
77
  flags = Slacker.extract_build_flags($~[:flags])
75
78
  version = $~[:version]
76
79
  if Config.allowed_build_branches.include?(version)
77
80
  response = "OK, I've queued a build of the `#{version}` branch."
81
+ if flags.count > 0
82
+ response += " (#{flags.join(", ")})"
83
+ end
78
84
  scheduler.queue_a_build(BuildData.new(
79
85
  :type => :branch,
80
86
  :branch => version,
@@ -176,6 +182,9 @@ Stop any running build with `stop build bb-xxx`. Use `show queue` to get a vali
176
182
  text += " by *@#{build_data.stopped_by}*"
177
183
  end
178
184
  text += " ran for `#{build_data.run_time}`"
185
+ if build_data.flags.count > 0
186
+ text += " (#{build_data.flags.join(", ")})"
187
+ end
179
188
  attachments.push({
180
189
  :mrkdwn_in => [ :text ],
181
190
  :text => text,
@@ -204,7 +213,11 @@ Stop any running build with `stop build bb-xxx`. Use `show queue` to get a vali
204
213
  unless build_data.started_by.nil?
205
214
  response += " by *@#{build_data.started_by}*"
206
215
  end
207
- response += " running for `#{build_data.run_time}`."
216
+ response += " running for `#{build_data.run_time}`"
217
+ if build_data.flags.count > 0
218
+ response += " (#{build_data.flags.join(", ")})"
219
+ end
220
+ response += '.'
208
221
  if queue_length == 0
209
222
  response += " No builds in the queue."
210
223
  elsif queue_length > 1
@@ -229,6 +242,9 @@ Stop any running build with `stop build bb-xxx`. Use `show queue` to get a vali
229
242
  unless build_data.started_by.nil?
230
243
  text += " by *@#{build_data.started_by}*"
231
244
  end
245
+ if build_data.flags.count > 0
246
+ response += " (#{build_data.flags.join(", ")})"
247
+ end
232
248
  attachments.push({
233
249
  :mrkdwn_in => [ :text ],
234
250
  :text => text,
@@ -328,7 +344,7 @@ Stop any running build with `stop build bb-xxx`. Use `show queue` to get a vali
328
344
  response, attachments = case message
329
345
  when /stop +build +(bb-\d+)/i
330
346
  do_stop $1, is_from_slack_channel, slack_user_name
331
- when /build +([a-z0-9\.]+)/i
347
+ when /build +([a-z0-9, ]+)/i
332
348
  do_build $1, is_from_slack_channel, slack_user_name
333
349
  when /(?:show +)?status/
334
350
  do_show_status
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.15.0
4
+ version: 1.16.0
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-12-20 00:00:00.000000000 Z
11
+ date: 2016-12-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: timers