blower 5.0a2 → 5.0a3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/blower/context.rb +8 -2
- data/lib/blower/host.rb +2 -0
- data/lib/blower/local.rb +8 -1
- data/lib/blower/util.rb +6 -0
- data/lib/blower/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6369e5b4ff95c392dbe748cf592958afe1964df32bf53207e82c3a21f7e8c071
|
4
|
+
data.tar.gz: 193302c6641c9ce020bde5f52e2c06da7d3df84cdd57c1a2a222f2f4a5f06752
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 39655aa9b776541e74953935aa5201041c530e4847c62a4972dd0b8048b65cdf75d23880dc7d8064e6160305c2654a51f9f71853f2808f5753170c288a34703a
|
7
|
+
data.tar.gz: f0987ab1d943d0285ac29bdd6afcc9ff19548b833ac7350cee853ffabd6086d6bf2dd09e634ecb2e4bbf28803bac15bd3b22847eb6ac75445fbd8c60b587367c
|
data/lib/blower/context.rb
CHANGED
@@ -95,7 +95,7 @@ module Blower
|
|
95
95
|
def on (*hosts, quiet: false)
|
96
96
|
let :@hosts => hosts.flatten do
|
97
97
|
log.info "on #{@hosts.map(&:name).join(", ")}", quiet: quiet do
|
98
|
-
yield
|
98
|
+
yield *hosts
|
99
99
|
end
|
100
100
|
end
|
101
101
|
end
|
@@ -142,6 +142,12 @@ module Blower
|
|
142
142
|
raise e
|
143
143
|
end
|
144
144
|
|
145
|
+
def sh? (command, as: user, on: hosts, quiet: false, once: nil)
|
146
|
+
sh command, as: as, on: on, quiet: quiet, once: once
|
147
|
+
rescue
|
148
|
+
nil
|
149
|
+
end
|
150
|
+
|
145
151
|
# Execute a shell command on each host
|
146
152
|
# @macro onable
|
147
153
|
# @macro asable
|
@@ -347,7 +353,7 @@ module Blower
|
|
347
353
|
end
|
348
354
|
|
349
355
|
def on_each (hosts = self.hosts, serial: true)
|
350
|
-
each(hosts, serial: serial) do |host, i|
|
356
|
+
each(hosts.dup, serial: serial) do |host, i|
|
351
357
|
on host do
|
352
358
|
singularly do
|
353
359
|
yield host, i
|
data/lib/blower/host.rb
CHANGED
@@ -55,6 +55,7 @@ module Blower
|
|
55
55
|
# Copy files or directories to the host.
|
56
56
|
# @api private
|
57
57
|
def cp (froms, to, as: nil, quiet: false, delete: false)
|
58
|
+
sleep DELAY if DELAY
|
58
59
|
as ||= @user
|
59
60
|
output = ""
|
60
61
|
synchronize do
|
@@ -110,6 +111,7 @@ module Blower
|
|
110
111
|
# Execute a command on the host and return its output.
|
111
112
|
# @api private
|
112
113
|
def sh (command, as: nil, quiet: false)
|
114
|
+
sleep DELAY if DELAY
|
113
115
|
as ||= @user
|
114
116
|
output = ""
|
115
117
|
synchronize do
|
data/lib/blower/local.rb
CHANGED
@@ -27,7 +27,14 @@ module Blower
|
|
27
27
|
|
28
28
|
def sh (command, as: nil, quiet: false)
|
29
29
|
command = "#{@proxy} #{command.shellescape}" if @proxy
|
30
|
-
IO.popen(command)
|
30
|
+
result = IO.popen(command) do |io|
|
31
|
+
io.read
|
32
|
+
end
|
33
|
+
if $?.success?
|
34
|
+
result
|
35
|
+
else
|
36
|
+
raise "Command failed"
|
37
|
+
end
|
31
38
|
end
|
32
39
|
|
33
40
|
# Produce a Logger prefixed with the host name.
|
data/lib/blower/util.rb
CHANGED
data/lib/blower/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: blower
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.
|
4
|
+
version: 5.0a3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nathan Baum
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-05-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: net-ssh
|
@@ -159,7 +159,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
159
159
|
- !ruby/object:Gem::Version
|
160
160
|
version: 1.3.1
|
161
161
|
requirements: []
|
162
|
-
rubygems_version: 3.0.
|
162
|
+
rubygems_version: 3.0.3
|
163
163
|
signing_key:
|
164
164
|
specification_version: 4
|
165
165
|
summary: Really simple server orchestration
|