build-buddy 1.1.1 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/build_buddy.rb +1 -1
- data/lib/build_buddy/builder.rb +11 -9
- data/lib/build_buddy/server.rb +6 -6
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 20b7313e36172e051a99a9b341a94fc92338455a
|
4
|
+
data.tar.gz: 578b2c07c30fc4d4cf678049ae2e9212883e1857
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 144e5b4600e573917693fd6389c8d7e9e7f9ea1d53a27f65806779014cbdbe6748c2add4ded28a36f619830348bd43e4a552f902a8322bf5c71920d3006e9ad3
|
7
|
+
data.tar.gz: c96c2800fa8975b29e3511c23dc108c78f316f103d61f6245b0d33d36098daaeacc8a9dfebcf85f3ad217930f5e4b0b6c520f55d6952a6fcd8949d32f9d0e212
|
data/lib/build_buddy.rb
CHANGED
data/lib/build_buddy/builder.rb
CHANGED
@@ -15,6 +15,7 @@ module BuildBuddy
|
|
15
15
|
|
16
16
|
def initialize
|
17
17
|
@pid = nil
|
18
|
+
@gid = nil
|
18
19
|
@watcher = nil
|
19
20
|
end
|
20
21
|
|
@@ -27,7 +28,9 @@ module BuildBuddy
|
|
27
28
|
"GIT_REPO_NAME" => repo_parts[1],
|
28
29
|
"RBENV_DIR" => nil,
|
29
30
|
"RBENV_VERSION" => nil,
|
30
|
-
"
|
31
|
+
"RBENV_HOOK_PATH" => nil,
|
32
|
+
"RBENV_ROOT" => nil,
|
33
|
+
"PATH" => ENV['PATH'].split(':').select { |v| !v.match(/\.rbenv\/versions|Cellar\/rbenv/) }.join(':')
|
31
34
|
}
|
32
35
|
|
33
36
|
case build_data.build_type
|
@@ -43,15 +46,14 @@ module BuildBuddy
|
|
43
46
|
raise "Unknown build type"
|
44
47
|
end
|
45
48
|
|
46
|
-
build_log_filename = File.join(Config.build_log_dir, "build_#{build_data.build_type.to_s}_#{Time.now.utc.strftime('%Y%m%d%
|
49
|
+
build_log_filename = File.join(Config.build_log_dir, "build_#{build_data.build_type.to_s}_#{Time.now.utc.strftime('%Y%m%d%_H%M%S')}.log")
|
47
50
|
build_data.build_log_filename = build_log_filename
|
48
51
|
|
49
|
-
command += " >#{build_log_filename} 2>&1"
|
50
|
-
|
51
52
|
Bundler.with_clean_env do
|
52
|
-
@pid = Process.spawn(env, command)
|
53
|
+
@pid = Process.spawn(env, command, :pgroup => true, [:out, :err] => build_log_filename)
|
54
|
+
@gid = Process.getpgid(@pid)
|
53
55
|
end
|
54
|
-
info "Running
|
56
|
+
info "Running #{File.basename(command)} (pid #{@pid}, gid #{@gid}) : Log #{build_log_filename}"
|
55
57
|
|
56
58
|
if @watcher
|
57
59
|
@watcher.terminate
|
@@ -71,9 +73,9 @@ module BuildBuddy
|
|
71
73
|
end
|
72
74
|
|
73
75
|
def stop_build
|
74
|
-
if @
|
75
|
-
info "Killing
|
76
|
-
Process.kill(:SIGABRT,
|
76
|
+
if @gid
|
77
|
+
info "Killing gid #{@gid}"
|
78
|
+
Process.kill(:SIGABRT, -@gid)
|
77
79
|
end
|
78
80
|
end
|
79
81
|
end
|
data/lib/build_buddy/server.rb
CHANGED
@@ -126,7 +126,7 @@ module BuildBuddy
|
|
126
126
|
Celluloid::Actor[:builder].async.stop_build
|
127
127
|
end
|
128
128
|
else
|
129
|
-
response = "Sorry#{in_channel ? " <@#{data['user']}>" : ""}, I'm not sure if you want do
|
129
|
+
response = "Sorry#{in_channel ? " <@#{data['user']}>" : ""}, I'm not sure if you want do a *master*, or *M.m* branch build, or maybe *stop* any running build?"
|
130
130
|
end
|
131
131
|
end
|
132
132
|
when /status/i
|
@@ -219,9 +219,9 @@ module BuildBuddy
|
|
219
219
|
{ :description => "This build is in the queue" })
|
220
220
|
info "Pull request build queued"
|
221
221
|
when :master
|
222
|
-
info "
|
222
|
+
info "`master` branch build queued"
|
223
223
|
when :release
|
224
|
-
info "
|
224
|
+
info "Release branch build queued"
|
225
225
|
end
|
226
226
|
|
227
227
|
if @build_timer.nil?
|
@@ -258,16 +258,16 @@ module BuildBuddy
|
|
258
258
|
@gh_client.create_status(
|
259
259
|
build_data.repo_full_name, build_data.repo_sha,
|
260
260
|
build_data.termination_type == :killed ? 'failure' : build_data.exit_code != 0 ? 'error' : 'success',
|
261
|
-
{ :description => description })
|
261
|
+
{ :description => description.length > 140 ? "#{description[0..137]}..." : description })
|
262
262
|
info "Pull request build #{term_msg}"
|
263
263
|
else
|
264
264
|
case build_data.build_type
|
265
265
|
when :master
|
266
266
|
message = "A build of the `master` branch #{term_msg}."
|
267
|
-
info "
|
267
|
+
info "`master` branch build #{term_msg}"
|
268
268
|
when :release
|
269
269
|
message = "A build of the `#{build_data.build_version}` branch #{term_msg}."
|
270
|
-
info "
|
270
|
+
info "Release branch build #{term_msg}"
|
271
271
|
end
|
272
272
|
unless @notify_slack_channel.nil?
|
273
273
|
@rt_client.message(channel: @notify_slack_channel, text: 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.
|
4
|
+
version: 1.2.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-01-
|
11
|
+
date: 2016-01-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: timers
|