aerosol 1.0.2 → 1.1.0
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/aerosol/deploy.rb +4 -2
- data/lib/aerosol/runner.rb +15 -7
- data/lib/aerosol/version.rb +1 -1
- data/spec/aerosol/deploy_spec.rb +18 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 31c767638dd285ff3db576f4dacdaff662ca52e8
|
4
|
+
data.tar.gz: 4052d794ed7b58ab82fd571a28ce9e9c52255458
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f4b7fcfcb3958c646d6c2707a91fb9cff4b72186f679d63129872cb5d2dcfb4694282c6b0fb3b73d211dabb33cfaf77e2ddd54357c95d4aa37fd8ff2a652d92d
|
7
|
+
data.tar.gz: f1240b253337fd73fd9316808ceb08d0d12676905f539c6d25469ae5431b6be43453d25a4647f080593bf0e5c948616b17f4f4c8cca0b5b11441107bed0c575a
|
data/lib/aerosol/deploy.rb
CHANGED
@@ -36,8 +36,10 @@ class Aerosol::Deploy
|
|
36
36
|
@live_check
|
37
37
|
end
|
38
38
|
|
39
|
-
def is_alive?(&block)
|
40
|
-
|
39
|
+
def is_alive?(command = nil, &block)
|
40
|
+
fail 'Command and block specified' if command && block
|
41
|
+
@is_alive = block if block
|
42
|
+
@is_alive = command if command
|
41
43
|
@is_alive
|
42
44
|
end
|
43
45
|
|
data/lib/aerosol/runner.rb
CHANGED
@@ -106,13 +106,18 @@ class Aerosol::Runner
|
|
106
106
|
ssh.with_connection(instance) do |session|
|
107
107
|
start_tailing_logs(ssh, instance) if log_pids[instance.instance_id].nil?
|
108
108
|
debug "checking if #{instance.instance_id} is healthy"
|
109
|
-
success =
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
109
|
+
success =
|
110
|
+
case is_alive?
|
111
|
+
when Proc
|
112
|
+
debug 'Using custom site live check'
|
113
|
+
is_alive?.call(session, self)
|
114
|
+
when String
|
115
|
+
debug "Using custom site live check: #{is_alive?}"
|
116
|
+
check_live_with(session, is_alive?)
|
117
|
+
else
|
118
|
+
debug 'Using default site live check'
|
119
|
+
check_site_live(session)
|
120
|
+
end
|
116
121
|
end
|
117
122
|
|
118
123
|
if success
|
@@ -136,7 +141,10 @@ class Aerosol::Runner
|
|
136
141
|
'-O',
|
137
142
|
'/dev/null'
|
138
143
|
].compact.join(' ')
|
144
|
+
check_live_with(session, command)
|
145
|
+
end
|
139
146
|
|
147
|
+
def check_live_with(session, command)
|
140
148
|
debug "running #{command}"
|
141
149
|
ret = ssh_exec!(session, command)
|
142
150
|
debug "finished running #{command}"
|
data/lib/aerosol/version.rb
CHANGED
data/spec/aerosol/deploy_spec.rb
CHANGED
@@ -180,7 +180,24 @@ describe Aerosol::Deploy do
|
|
180
180
|
end
|
181
181
|
end
|
182
182
|
|
183
|
-
context 'when
|
183
|
+
context 'when a command and block are given' do
|
184
|
+
it 'fails' do
|
185
|
+
expect { subject.is_alive?('true', &check) }.to raise_error
|
186
|
+
end
|
187
|
+
end
|
188
|
+
|
189
|
+
context 'when a command is given' do
|
190
|
+
let(:command) { 'bash -lc "[[ -e /tmp/up ]]"' }
|
191
|
+
|
192
|
+
it 'sets is_alive? to that value' do
|
193
|
+
expect { subject.is_alive?(command) }
|
194
|
+
.to change { subject.is_alive? }
|
195
|
+
.from(nil)
|
196
|
+
.to(command)
|
197
|
+
end
|
198
|
+
end
|
199
|
+
|
200
|
+
context 'when a block is given' do
|
184
201
|
it 'sets is_alive? to that value' do
|
185
202
|
expect { subject.is_alive?(&check) }
|
186
203
|
.to change { subject.is_alive? }
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aerosol
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Swipely, Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-07-
|
11
|
+
date: 2015-07-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -275,7 +275,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
275
275
|
version: '0'
|
276
276
|
requirements: []
|
277
277
|
rubyforge_project:
|
278
|
-
rubygems_version: 2.
|
278
|
+
rubygems_version: 2.4.5
|
279
279
|
signing_key:
|
280
280
|
specification_version: 4
|
281
281
|
summary: Instance-based deploys made easy
|
@@ -293,3 +293,4 @@ test_files:
|
|
293
293
|
- spec/aerosol_spec.rb
|
294
294
|
- spec/spec_helper.rb
|
295
295
|
- spec/support/vcr.rb
|
296
|
+
has_rdoc:
|