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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 832792b12e68e17d1db4be736d39c9336e98bd99
4
- data.tar.gz: 910b11938e36f43f7a6ced19dfd7a561ceee0d8a
3
+ metadata.gz: ef642027dcd39feaf45207dd2ed7df8cf5d26616
4
+ data.tar.gz: 4bd38248f760e1ef7b5feea6a3ccd479182864ed
5
5
  SHA512:
6
- metadata.gz: 13bf1dd9a2954146bdbe181b5b064a7fcf028786fbe2e8be79f3cf1397bca87e7e7cd84ab4319846d03a5ef4835bdc8080346dd13dd124159fc8d2fdba5811a2
7
- data.tar.gz: 4716579fc9991b71496aac673f36dab70f082361e30220ca1d654c39da945f9a71abdb17c9b934d4912ce16d8cf0151cd6b7f78da8f9481f88819475b106e46d
6
+ metadata.gz: a7bb87ccf61a0650a40b6669b0abd9a920f9c30b587fd0cbb185787fb28d75d6a84de30e0c3ebcf0ecf3e003d8454e08b9267b4627f55a972f4c6bbda5600f50
7
+ data.tar.gz: 2ba87b2d56034443a4ba4e39d8e986bc03660a336f37a834a770b685ef0d458477744a28f8b526142c40e776a804cd31bd20536c9c6cb0ac25e1165c7325546f
data/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## HEAD:
2
+
3
+ ## v0.8.1 (03/25/14):
4
+
5
+ * Update fog to 1.21
6
+ * Instances and Deploy support for multi ASGs in stack
7
+
1
8
  ## v0.8.0 (12/13/13):
2
9
 
3
10
  * Added flag to specify external ips
@@ -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
- asg_instances = list_instances asg_id
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 => @config.access_key,
24
+ @asg ||= Fog::AWS::AutoScaling.new :aws_access_key_id => @config.access_key,
22
25
  :aws_secret_access_key => @config.secret_key,
23
- :region => @config.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 => @config.access_key,
36
+ @ec2 ||= Fog::Compute::AWS.new :aws_access_key_id => @config.access_key,
34
37
  :aws_secret_access_key => @config.secret_key,
35
- :region => @config.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.first['PhysicalResourceId'] : false
57
+ asgs.any? ? asgs.map {|asg| asg['PhysicalResourceId'] } : false
55
58
  end
56
59
 
57
60
  end
@@ -123,7 +123,7 @@ module SimpleDeploy
123
123
  def instances
124
124
  stack_reader.instances.map do |instance|
125
125
  instance['instancesSet'].map do |info|
126
- determine_ip_address(info)
126
+ determine_ip_address(info)
127
127
  end
128
128
  end.flatten.compact
129
129
  end
@@ -1,3 +1,3 @@
1
1
  module SimpleDeploy
2
- VERSION = "0.8.0"
2
+ VERSION = "0.8.1.beta1"
3
3
  end
@@ -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.18.0"
31
- s.add_runtime_dependency "excon", "= 0.28.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 ASG" do
48
+ context "with an ASGs" do
49
49
  before do
50
- stack_resource_results = [{'StackName' => 'stack',
51
- 'ResourceType' => 'AWS::AutoScaling::AutoScalingGroup',
52
- 'PhysicalResourceId' => 'asg1'}]
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
- @auto_scaling_groups_mock.should_receive(:describe_auto_scaling_groups).
65
- with('AutoScalingGroupNames' => ['asg1']).
66
- and_return(@empty_response)
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.0
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: 2013-12-13 00:00:00.000000000 Z
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.18.0
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.18.0
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.28.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.28.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: '0'
312
+ version: 1.3.1
313
313
  requirements: []
314
314
  rubyforge_project: simple_deploy
315
- rubygems_version: 2.0.6
315
+ rubygems_version: 2.0.3
316
316
  signing_key:
317
317
  specification_version: 4
318
318
  summary: Opinionated gem for AWS resource management.