hocho 0.3.0 → 0.3.1

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
  SHA256:
3
- metadata.gz: 02bd4fdb528bce052b2fbbdf13094a22dd66eaf4cea358cfdf458ad744e16e7c
4
- data.tar.gz: 133bea775d5dd49cceaca4f24abf0cb47b1bf67583d51879c37643bda8b9d8aa
3
+ metadata.gz: a842112a88e2159de9edb1544967ece4d054f30f7af102da56f101264732dded
4
+ data.tar.gz: 255602f3163282c8e97eacf3ed96193bdf6c4d1d6a8ce65033fa561e5dc27756
5
5
  SHA512:
6
- metadata.gz: 8cc5f789571a9c32c8ef2633ea5ef78b128d85e8ce5c7900bb155138bd944deeb031e7fd2d3715059a1916f8c05837269a8bc9c4426f19218304308aaa41af53
7
- data.tar.gz: b7985500b353068b4e0a7433db48b396c5f856b29d037bc3208c0420765d38dd8ec986d5a857556b56480fa210f796308d1d54b9c7e2ac8f0b5e1ea738fcc981
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
- rsync_cmd = [*%w(rsync -az --copy-links --copy-unsafe-links --delete --exclude=.git), *shm_exclude, '--rsh', ssh_cmd, '.', "#{host.hostname}:#{host_basedir}"]
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 -az --copy-links --copy-unsafe-links --delete), *shm_include, '--exclude=*', '--rsh', ssh_cmd, '.', "#{host.hostname}:#{host_shm_basedir}"]
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
 
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Hocho
2
- VERSION = "0.3.0"
2
+ VERSION = "0.3.1"
3
3
  end
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.0
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: 2019-02-22 00:00:00.000000000 Z
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.1
170
+ rubygems_version: 3.0.3
171
171
  signing_key:
172
172
  specification_version: 4
173
173
  summary: Server provisioning tool with itamae