kondate 0.4.7 → 0.4.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/CHANGELOG.md +6 -0
- data/kondate.gemspec +1 -0
- data/lib/kondate/cli.rb +42 -2
- data/lib/kondate/itamae_bootstrap.rb +2 -0
- data/lib/kondate/templates/spec/spec_helper.rb +2 -0
- data/lib/kondate/version.rb +1 -1
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b54a2f96280eb909e0e542d324820de43b6ade6b
|
4
|
+
data.tar.gz: 424d90982dbb240817604b84dd42c25eb17e49cb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fafee50e2a6a054acf7251c97757274bb8579a0ef53e41cc288fc1fc1a220f5cf55a1c8d722e5fcb2a0c4e2bdda7f27334777132cfce86379ff6f02765f45c59
|
7
|
+
data.tar.gz: 6de4e87c5b2df2cf9d3c8bc4ad39aa0ce15a14f231b255df825b66a2202295f768f6ab733d00e53d87f4cbc5acd8313385e6b7bec03a1b4223e5cd25f8cf6233
|
data/.gitignore
CHANGED
data/CHANGELOG.md
CHANGED
data/kondate.gemspec
CHANGED
@@ -25,6 +25,7 @@ Gem::Specification.new do |spec|
|
|
25
25
|
spec.add_dependency 'highline'
|
26
26
|
spec.add_dependency 'facter'
|
27
27
|
spec.add_dependency 'parallel'
|
28
|
+
spec.add_dependency 'frontkick'
|
28
29
|
|
29
30
|
spec.add_development_dependency "bundler"
|
30
31
|
spec.add_development_dependency "test-unit"
|
data/lib/kondate/cli.rb
CHANGED
@@ -8,6 +8,7 @@ require 'shellwords'
|
|
8
8
|
require 'find'
|
9
9
|
require 'facter'
|
10
10
|
require 'parallel'
|
11
|
+
require 'frontkick'
|
11
12
|
|
12
13
|
module Kondate
|
13
14
|
class CLI < Thor
|
@@ -156,7 +157,11 @@ module Kondate
|
|
156
157
|
command << " --recipe-graph=#{@options[:recipe_graph]}" if @options[:recipe_graph]
|
157
158
|
command << " bootstrap.rb"
|
158
159
|
$stdout.puts "env #{env.map {|k, v| "#{k}=#{v.shellescape}" }.join(' ')} #{command}"
|
159
|
-
|
160
|
+
|
161
|
+
output_with_hostname(host) do |out, err|
|
162
|
+
result = Frontkick.exec(env, command, out: out, err: err)
|
163
|
+
return false unless result.successful?
|
164
|
+
end
|
160
165
|
end
|
161
166
|
true
|
162
167
|
end
|
@@ -181,11 +186,46 @@ module Kondate
|
|
181
186
|
env['TARGET_NODE_FILE'] = property_file.path
|
182
187
|
command = "bundle exec rspec #{spec_files.map{|f| f.shellescape }.join(' ')}"
|
183
188
|
$stdout.puts "env #{env.map {|k, v| "#{k}=#{v.shellescape}" }.join(' ')} #{command}"
|
184
|
-
|
189
|
+
|
190
|
+
output_with_hostname(host) do |out, err|
|
191
|
+
result = Frontkick.exec(env, command, out: out, err: err)
|
192
|
+
return false unless result.successful?
|
193
|
+
end
|
185
194
|
end
|
186
195
|
true
|
187
196
|
end
|
188
197
|
|
198
|
+
def output_with_hostname(host, &block)
|
199
|
+
out_r, out_w = IO.pipe
|
200
|
+
out_w.sync = true
|
201
|
+
err_r, err_w = IO.pipe
|
202
|
+
err_w.sync = true
|
203
|
+
|
204
|
+
$stdout.sync = true
|
205
|
+
$stderr.sync = true
|
206
|
+
|
207
|
+
out_thr = Thread.new do
|
208
|
+
while r = out_r.gets
|
209
|
+
$stdout.write "#{host} | #{r}"
|
210
|
+
end
|
211
|
+
end
|
212
|
+
|
213
|
+
err_thr = Thread.new do
|
214
|
+
while r = err_r.gets
|
215
|
+
$stderr.write "#{host} | #{r}"
|
216
|
+
end
|
217
|
+
end
|
218
|
+
|
219
|
+
yield(out_w, err_w)
|
220
|
+
ensure
|
221
|
+
out_r.close rescue nil
|
222
|
+
out_w.close rescue nil
|
223
|
+
err_r.close rescue nil
|
224
|
+
err_w.close rescue nil
|
225
|
+
out_thr.exit rescue nil
|
226
|
+
err_thr.exit rescue nil
|
227
|
+
end
|
228
|
+
|
189
229
|
def proceed?(property_files)
|
190
230
|
if property_files.values.compact.reject(&:empty?).empty?
|
191
231
|
$stderr.puts "Nothing to run"
|
data/lib/kondate/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kondate
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- sonots
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-01-
|
11
|
+
date: 2017-01-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: itamae
|
@@ -94,6 +94,20 @@ dependencies:
|
|
94
94
|
- - ">="
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: frontkick
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :runtime
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
97
111
|
- !ruby/object:Gem::Dependency
|
98
112
|
name: bundler
|
99
113
|
requirement: !ruby/object:Gem::Requirement
|