simple_provision 0.99.6 → 0.99.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/simple_provision/cli.rb +27 -6
- data/lib/simple_provision/version.rb +1 -1
- 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: 1880038fa6fc6527cc8254327d4d437b3992879d
|
4
|
+
data.tar.gz: c6d6ed67a21d7a2e550b26dc4447dae7562e74fc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b568f45887448deabba648a8bf9b382d780ffa4f2deba649805e6733a4ba994b4f6a2f8099a16f5adc4edb4846630b6af753499f638c6401119bec3812a69177
|
7
|
+
data.tar.gz: a43dbbdaa583a1a3a49ee94242e87261652d9c5137fae681d455dec3398496fc18ca46e1e87953c5fb84b8162f7e48754f2926163cc0233a0e966ad9d39ef0db
|
data/lib/simple_provision/cli.rb
CHANGED
@@ -14,14 +14,35 @@ module SimpleProvision
|
|
14
14
|
end
|
15
15
|
|
16
16
|
def configure
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
17
|
+
begin
|
18
|
+
Net::SSH.start(host, username) do |ssh|
|
19
|
+
ssh.exec! "tar -xzf #{SimpleProvision::SCP::FILENAME}"
|
20
|
+
scripts = options.fetch(:scripts).each do |script|
|
21
|
+
puts "Execute #{script}"
|
22
|
+
ssh.open_channel do |ssh_channel|
|
23
|
+
ssh_channel.request_pty
|
24
|
+
ssh_channel.exec("#{environment_exports} bash -c '#{script}'") do |channel, success|
|
25
|
+
unless success
|
26
|
+
raise "Could not execute command: #{command.inspect}"
|
27
|
+
end
|
28
|
+
|
29
|
+
channel.on_data do |ch, data|
|
30
|
+
STDOUT << data
|
31
|
+
end
|
32
|
+
|
33
|
+
channel.on_extended_data do |ch, type, data|
|
34
|
+
next unless type == 1
|
35
|
+
STDERR << data
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
ssh.loop
|
23
40
|
end
|
24
41
|
end
|
42
|
+
rescue Net::SSH::HostKeyMismatch => exception
|
43
|
+
exception.remember_host!
|
44
|
+
sleep 0.2
|
45
|
+
retry
|
25
46
|
end
|
26
47
|
end
|
27
48
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simple_provision
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.99.
|
4
|
+
version: 0.99.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Phuong Gia Su
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-07-
|
12
|
+
date: 2014-07-18 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|