kumogata 0.3.12 → 0.3.13

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- Y2E5OGQ4ZGRjNGI4MWJlNTBlNjQ0NzYzZDY3NTIwYmM0MzVmOTk0Mw==
4
+ ZDVkOTFjYWZhMzc2OTdhYjlkM2RlYWY3ZDI4MjcyYzNjYmZlN2NhYQ==
5
5
  data.tar.gz: !binary |-
6
- ODAxMjk3ZjIzZTdkZDM1YzAwZjdlOTY3MGEwNzk2Yjk1ODEyNzA5ZQ==
6
+ MmYyNjA2YjZkZTZjNzJkZDljOWQzNjU2NzNkMDgwYjQ3MzBiN2Q5Nw==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- ZWY5YmQ2MmYyMjI5ODQyODk3OGE0YzYwMzg4ZGU5OTMzZWNkZjAyZTEyMjgx
10
- NjgwNmM3YzJiOGU3NGM3YmJlNGI1NjIwOGQ4YzEzMjM5NDA1YTUwNDcyMjEz
11
- ZjA4NTVjY2MxODk4NTMxMzQ3NGE1ZTg1YWQyNGNjMTUyOTEzOGQ=
9
+ NDBjZDk1YTY2YTZkMDM1YjkzMDE1ZDU3ZDdiOTZlNTFhYWY4NGQ3YmY1OGNk
10
+ YmMwZDc5Yzc3MmI0MTExNzU0ZTNhYTQ0MTI2ZTFlZWJhYTg5MzcyZjY2ZjJm
11
+ NmZhYjQ2ZWMyMjU3OGUxMTA3MThlNzdmNjk4ODhlYjQ2YmE5NmQ=
12
12
  data.tar.gz: !binary |-
13
- ZDA1ZDk0YTQ0OWI2NjQxZTliYTViNWY3NDc1NDQ2ZDhkZTQyNmM3NGM2OGEy
14
- OWFlZDcwOTUxY2Q2MGFmODEzY2RiYWRlNWU5NDI0MzBjNzgyNTVkZTE0ZGM1
15
- MDViOThiMGYwOTNmYjZhMzQ1YmI0MmEzZjE5MjRiYjY4MTE5YmE=
13
+ MTRiY2EzMDIyYjBkZDdhNmYyOTgwZTM1ZDg3ZWEzMjc3MGViMmY0NjhlMzE1
14
+ NTExMjFmNmI4ZmUzM2M2MWFkZmNlY2MyODI3ODY1MjI0Yzk4Y2JiZDZiMDFm
15
+ NWM0MmVkMjljMGNjYTNmNDViNWRhYjIyNDYwNDgzMzAxNDNmNTI=
data/README.md CHANGED
@@ -5,8 +5,8 @@
5
5
 
6
6
  Kumogata is a tool for [AWS CloudFormation](https://aws.amazon.com/cloudformation/).
7
7
 
8
- [![Gem Version](https://badge.fury.io/rb/kumogata.png?201403111115)](http://badge.fury.io/rb/kumogata)
9
- [![Build Status](https://drone.io/github.com/winebarrel/kumogata/status.png?201403111115)](https://drone.io/github.com/winebarrel/kumogata/latest)
8
+ [![Gem Version](https://badge.fury.io/rb/kumogata.png?201403111456)](http://badge.fury.io/rb/kumogata)
9
+ [![Build Status](https://drone.io/github.com/winebarrel/kumogata/status.png?201403111456)](https://drone.io/github.com/winebarrel/kumogata/latest)
10
10
 
11
11
  It can define a template in Ruby DSL, such as:
12
12
 
@@ -305,6 +305,10 @@ _post do
305
305
  ssh do
306
306
  host { Key "MyPublicIp" } # or '<%= Key "MyPublicIp" %>'
307
307
  user "ec2-user"
308
+ # see http://net-ssh.github.io/net-ssh/classes/Net/SSH.html#method-c-start
309
+ #options :timeout => 300
310
+ #connect_tries 10
311
+ #retry_interval 5
308
312
  end
309
313
  command <<-EOS
310
314
  hostname
data/kumogata.gemspec CHANGED
@@ -26,6 +26,7 @@ Gem::Specification.new do |spec|
26
26
  spec.add_dependency 'highline'
27
27
  spec.add_dependency 'json'
28
28
  spec.add_dependency 'net-ssh'
29
+ spec.add_dependency 'retryable'
29
30
  spec.add_dependency 'term-ansicolor'
30
31
  spec.add_dependency 'uuidtools'
31
32
  spec.add_development_dependency 'bundler'
@@ -132,8 +132,13 @@ class Kumogata::PostProcessing
132
132
 
133
133
  command = evaluate_command_template(command, outputs)
134
134
 
135
+ connect_tries = (ssh['connect_tries'] || 36).to_i
136
+ retry_interval = (ssh['retry_interval'] || 5).to_i
137
+
135
138
  begin
136
- Net::SSH.start(*args) {|ssh| ssh_exec!(ssh, command) }
139
+ retryable(:tries => connect_tries, :on => Net::SSH::Disconnect, :sleep => retry_interval) do
140
+ Net::SSH.start(*args) {|ssh| ssh_exec!(ssh, command) }
141
+ end
137
142
  rescue Net::SSH::HostKeyMismatch => e
138
143
  e.remember_host!
139
144
  retry
@@ -1,3 +1,3 @@
1
1
  module Kumogata
2
- VERSION = '0.3.12'
2
+ VERSION = '0.3.13'
3
3
  end
data/lib/kumogata.rb CHANGED
@@ -14,6 +14,7 @@ require 'net/ssh'
14
14
  require 'open-uri'
15
15
  require 'open3'
16
16
  require 'optparse'
17
+ require 'retryable'
17
18
  require 'set'
18
19
  require 'singleton'
19
20
  require 'strscan'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kumogata
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.12
4
+ version: 0.3.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Genki Sugawara
@@ -122,6 +122,20 @@ dependencies:
122
122
  - - ! '>='
123
123
  - !ruby/object:Gem::Version
124
124
  version: '0'
125
+ - !ruby/object:Gem::Dependency
126
+ name: retryable
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - ! '>='
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
132
+ type: :runtime
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - ! '>='
137
+ - !ruby/object:Gem::Version
138
+ version: '0'
125
139
  - !ruby/object:Gem::Dependency
126
140
  name: term-ansicolor
127
141
  requirement: !ruby/object:Gem::Requirement