simple_deploy 0.8.0 → 0.8.1.beta1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -0
- data/lib/simple_deploy/aws/instance_reader.rb +11 -8
- data/lib/simple_deploy/stack.rb +1 -1
- data/lib/simple_deploy/version.rb +1 -1
- data/simple_deploy.gemspec +2 -2
- data/spec/aws/instance_reader_spec.rb +15 -7
- metadata +9 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ef642027dcd39feaf45207dd2ed7df8cf5d26616
|
4
|
+
data.tar.gz: 4bd38248f760e1ef7b5feea6a3ccd479182864ed
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a7bb87ccf61a0650a40b6669b0abd9a920f9c30b587fd0cbb185787fb28d75d6a84de30e0c3ebcf0ecf3e003d8454e08b9267b4627f55a972f4c6bbda5600f50
|
7
|
+
data.tar.gz: 2ba87b2d56034443a4ba4e39d8e986bc03660a336f37a834a770b685ef0d458477744a28f8b526142c40e776a804cd31bd20536c9c6cb0ac25e1165c7325546f
|
data/CHANGELOG.md
CHANGED
@@ -6,10 +6,13 @@ module SimpleDeploy
|
|
6
6
|
end
|
7
7
|
|
8
8
|
def list_stack_instances(stack_name)
|
9
|
-
asg_id = auto_scaling_group_id(stack_name)
|
10
|
-
return [] unless asg_id
|
11
9
|
|
12
|
-
|
10
|
+
asg_ids = auto_scaling_group_id(stack_name)
|
11
|
+
|
12
|
+
return [] unless asg_ids
|
13
|
+
|
14
|
+
asg_instances = asg_ids.map { |asg_id| list_instances asg_id }.flatten
|
15
|
+
|
13
16
|
return [] unless asg_instances.any?
|
14
17
|
|
15
18
|
describe_instances asg_instances
|
@@ -18,9 +21,9 @@ module SimpleDeploy
|
|
18
21
|
private
|
19
22
|
|
20
23
|
def list_instances(asg_id)
|
21
|
-
@asg ||= Fog::AWS::AutoScaling.new :aws_access_key_id
|
24
|
+
@asg ||= Fog::AWS::AutoScaling.new :aws_access_key_id => @config.access_key,
|
22
25
|
:aws_secret_access_key => @config.secret_key,
|
23
|
-
:region
|
26
|
+
:region => @config.region
|
24
27
|
|
25
28
|
body = @asg.describe_auto_scaling_groups('AutoScalingGroupNames' => [asg_id]).body
|
26
29
|
result = body['DescribeAutoScalingGroupsResult']['AutoScalingGroups'].last
|
@@ -30,9 +33,9 @@ module SimpleDeploy
|
|
30
33
|
end
|
31
34
|
|
32
35
|
def describe_instances(instances)
|
33
|
-
@ec2 ||= Fog::Compute::AWS.new :aws_access_key_id
|
36
|
+
@ec2 ||= Fog::Compute::AWS.new :aws_access_key_id => @config.access_key,
|
34
37
|
:aws_secret_access_key => @config.secret_key,
|
35
|
-
:region
|
38
|
+
:region => @config.region
|
36
39
|
|
37
40
|
@ec2.describe_instances('instance-state-name' => 'running',
|
38
41
|
'instance-id' => instances).body['reservationSet']
|
@@ -51,7 +54,7 @@ module SimpleDeploy
|
|
51
54
|
asgs = cf_stack_resources.select do |r|
|
52
55
|
r['ResourceType'] == 'AWS::AutoScaling::AutoScalingGroup'
|
53
56
|
end
|
54
|
-
asgs.any? ? asgs.
|
57
|
+
asgs.any? ? asgs.map {|asg| asg['PhysicalResourceId'] } : false
|
55
58
|
end
|
56
59
|
|
57
60
|
end
|
data/lib/simple_deploy/stack.rb
CHANGED
data/simple_deploy.gemspec
CHANGED
@@ -27,8 +27,8 @@ Gem::Specification.new do |s|
|
|
27
27
|
s.add_runtime_dependency "capistrano", "= 2.13.5"
|
28
28
|
s.add_runtime_dependency "esbit", "~> 0.0.4"
|
29
29
|
s.add_runtime_dependency "trollop", "= 2.0"
|
30
|
-
s.add_runtime_dependency "fog", "= 1.
|
31
|
-
s.add_runtime_dependency "excon", "= 0.
|
30
|
+
s.add_runtime_dependency "fog", "= 1.21.0"
|
31
|
+
s.add_runtime_dependency "excon", "= 0.32.0"
|
32
32
|
s.add_runtime_dependency "unf", "= 0.1.3"
|
33
33
|
s.add_runtime_dependency "unf_ext", "= 0.0.6"
|
34
34
|
end
|
@@ -45,11 +45,14 @@ describe SimpleDeploy::AWS::InstanceReader do
|
|
45
45
|
end
|
46
46
|
end
|
47
47
|
|
48
|
-
context "with an
|
48
|
+
context "with an ASGs" do
|
49
49
|
before do
|
50
|
-
stack_resource_results = [
|
51
|
-
|
52
|
-
|
50
|
+
stack_resource_results = []
|
51
|
+
@asgs = ['asg1', 'asg2'].each do |asg|
|
52
|
+
stack_resource_results << { 'StackName' => 'stack',
|
53
|
+
'ResourceType' => 'AWS::AutoScaling::AutoScalingGroup',
|
54
|
+
'PhysicalResourceId' => asg }
|
55
|
+
end
|
53
56
|
|
54
57
|
@cloud_formation_mock.should_receive(:stack_resources).
|
55
58
|
with('stack').
|
@@ -61,9 +64,11 @@ describe SimpleDeploy::AWS::InstanceReader do
|
|
61
64
|
|
62
65
|
context "with no running instances" do
|
63
66
|
it "should return empty array" do
|
64
|
-
@
|
65
|
-
|
66
|
-
|
67
|
+
@asgs.each do |asg|
|
68
|
+
@auto_scaling_groups_mock.should_receive(:describe_auto_scaling_groups).
|
69
|
+
with('AutoScalingGroupNames' => [asg]).
|
70
|
+
and_return(@empty_response)
|
71
|
+
end
|
67
72
|
|
68
73
|
instance_reader = SimpleDeploy::AWS::InstanceReader.new
|
69
74
|
instance_reader.list_stack_instances('stack').should == []
|
@@ -75,6 +80,9 @@ describe SimpleDeploy::AWS::InstanceReader do
|
|
75
80
|
@auto_scaling_groups_mock.should_receive(:describe_auto_scaling_groups).
|
76
81
|
with('AutoScalingGroupNames' => ['asg1']).
|
77
82
|
and_return(@list_response)
|
83
|
+
@auto_scaling_groups_mock.should_receive(:describe_auto_scaling_groups).
|
84
|
+
with('AutoScalingGroupNames' => ['asg2']).
|
85
|
+
and_return(@empty_response)
|
78
86
|
|
79
87
|
Fog::Compute::AWS.stub(:new).
|
80
88
|
and_return @ec2_mock
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simple_deploy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.1.beta1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brett Weaver
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-03-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fakefs
|
@@ -128,28 +128,28 @@ dependencies:
|
|
128
128
|
requirements:
|
129
129
|
- - '='
|
130
130
|
- !ruby/object:Gem::Version
|
131
|
-
version: 1.
|
131
|
+
version: 1.21.0
|
132
132
|
type: :runtime
|
133
133
|
prerelease: false
|
134
134
|
version_requirements: !ruby/object:Gem::Requirement
|
135
135
|
requirements:
|
136
136
|
- - '='
|
137
137
|
- !ruby/object:Gem::Version
|
138
|
-
version: 1.
|
138
|
+
version: 1.21.0
|
139
139
|
- !ruby/object:Gem::Dependency
|
140
140
|
name: excon
|
141
141
|
requirement: !ruby/object:Gem::Requirement
|
142
142
|
requirements:
|
143
143
|
- - '='
|
144
144
|
- !ruby/object:Gem::Version
|
145
|
-
version: 0.
|
145
|
+
version: 0.32.0
|
146
146
|
type: :runtime
|
147
147
|
prerelease: false
|
148
148
|
version_requirements: !ruby/object:Gem::Requirement
|
149
149
|
requirements:
|
150
150
|
- - '='
|
151
151
|
- !ruby/object:Gem::Version
|
152
|
-
version: 0.
|
152
|
+
version: 0.32.0
|
153
153
|
- !ruby/object:Gem::Dependency
|
154
154
|
name: unf
|
155
155
|
requirement: !ruby/object:Gem::Requirement
|
@@ -307,12 +307,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
307
307
|
version: '0'
|
308
308
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
309
309
|
requirements:
|
310
|
-
- - '
|
310
|
+
- - '>'
|
311
311
|
- !ruby/object:Gem::Version
|
312
|
-
version:
|
312
|
+
version: 1.3.1
|
313
313
|
requirements: []
|
314
314
|
rubyforge_project: simple_deploy
|
315
|
-
rubygems_version: 2.0.
|
315
|
+
rubygems_version: 2.0.3
|
316
316
|
signing_key:
|
317
317
|
specification_version: 4
|
318
318
|
summary: Opinionated gem for AWS resource management.
|