hocho 0.3.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/hocho/drivers/ssh_base.rb +4 -3
- data/lib/hocho/host.rb +5 -1
- data/lib/hocho/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: a842112a88e2159de9edb1544967ece4d054f30f7af102da56f101264732dded
|
4
|
+
data.tar.gz: 255602f3163282c8e97eacf3ed96193bdf6c4d1d6a8ce65033fa561e5dc27756
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6a11eac90ef61888470d47b4e0ed5cbfec05626106367f94851272ab54c11cf62d1d86486953b0d2cf9804e518cf0a414370802e3c17c6d1e900c90132db2d03
|
7
|
+
data.tar.gz: afab13846cfabd15f62cbf9f8d335bde577f1bc841871c858c7f14876b099ffe16be4d1e57245e21706e2f89eb955ed1a477db7a15f628f1d88b9cf8b77f8a9c
|
@@ -21,14 +21,15 @@ module Hocho
|
|
21
21
|
|
22
22
|
ssh_cmd = ['ssh', *host.openssh_config.flat_map { |l| ['-o', "\"#{l}\""] }].join(' ')
|
23
23
|
shm_exclude = shm_prefix.map{ |_| "--exclude=#{_}" }
|
24
|
-
|
24
|
+
compress = host.compress? ? ['-z'] : []
|
25
|
+
rsync_cmd = [*%w(rsync -a --copy-links --copy-unsafe-links --delete --exclude=.git), *compress, *shm_exclude, '--rsh', ssh_cmd, '.', "#{host.hostname}:#{host_basedir}"]
|
25
26
|
|
26
27
|
puts "=> $ #{rsync_cmd.shelljoin}"
|
27
28
|
system(*rsync_cmd, chdir: base_dir) or raise 'failed to rsync'
|
28
29
|
|
29
30
|
unless shm_prefix.empty?
|
30
31
|
shm_include = shm_prefix.map{ |_| "--include=#{_.sub(%r{/\z},'')}/***" }
|
31
|
-
rsync_cmd = [*%w(rsync -
|
32
|
+
rsync_cmd = [*%w(rsync -a --copy-links --copy-unsafe-links --delete), *compress, *shm_include, '--exclude=*', '--rsh', ssh_cmd, '.', "#{host.hostname}:#{host_shm_basedir}"]
|
32
33
|
puts "=> $ #{rsync_cmd.shelljoin}"
|
33
34
|
system(*rsync_cmd, chdir: base_dir) or raise 'failed to rsync'
|
34
35
|
shm_prefix.each do |x|
|
@@ -88,7 +89,7 @@ module Hocho
|
|
88
89
|
raise unless temp_executable.start_with?('/')
|
89
90
|
|
90
91
|
ssh_run("chmod 0700 #{temp_executable.shellescape}; cat > #{temp_executable.shellescape}; chmod +x #{temp_executable.shellescape}") do |ch|
|
91
|
-
ch.send_data("#!/bin/bash\nexec openssl enc -aes-128-cbc -d -a -md sha256 -pass env:#{passphrase_env_name} <<< #{encrypted_password.shellescape}\n")
|
92
|
+
ch.send_data("#!/bin/bash\nexec openssl enc -aes-128-cbc -d -a -md sha256 #{derive.shelljoin} -pass env:#{passphrase_env_name} <<< #{encrypted_password.shellescape}\n")
|
92
93
|
ch.eof!
|
93
94
|
end
|
94
95
|
|
data/lib/hocho/host.rb
CHANGED
@@ -197,7 +197,7 @@ module Hocho
|
|
197
197
|
alt = false
|
198
198
|
begin
|
199
199
|
Net::SSH.start(name, nil, ssh_options)
|
200
|
-
rescue Net::SSH::Exception => e
|
200
|
+
rescue Net::SSH::Exception, Errno::ECONNREFUSED, Net::SSH::Proxy::ConnectError => e
|
201
201
|
raise if alt
|
202
202
|
raise unless alternate_ssh_options_available?
|
203
203
|
puts "[#{name}] Trying alternate_ssh_options due to #{e.inspect}"
|
@@ -206,5 +206,9 @@ module Hocho
|
|
206
206
|
retry
|
207
207
|
end
|
208
208
|
end
|
209
|
+
|
210
|
+
def compress?
|
211
|
+
properties.fetch(:compress, true)
|
212
|
+
end
|
209
213
|
end
|
210
214
|
end
|
data/lib/hocho/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hocho
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- sorah (Shota Fukumori)
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-02-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -167,7 +167,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
167
167
|
- !ruby/object:Gem::Version
|
168
168
|
version: '0'
|
169
169
|
requirements: []
|
170
|
-
rubygems_version: 3.0.
|
170
|
+
rubygems_version: 3.0.3
|
171
171
|
signing_key:
|
172
172
|
specification_version: 4
|
173
173
|
summary: Server provisioning tool with itamae
|