elbas 0.12.0 → 0.13.0

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: 5a40ad08733e19aecb02ceabf847bf6a5fa8bf2b
4
- data.tar.gz: 1b29f93b0101c950286deeea6f9908574ad0439c
3
+ metadata.gz: 140ada691d91ac700a8ff21a4215b2460b15e668
4
+ data.tar.gz: 09b1414917cb47ee09853b36d831c94e10738b3e
5
5
  SHA512:
6
- metadata.gz: f7531cd6a3569954d6069e98726f624ffe8199f5e27469b160b58675f9219f6a012fae80460e12abf3057bd4a4caa85e1197d8b048860cace84fdfd2769da749
7
- data.tar.gz: b31bc141e5586561188ada7d0e34cda458263c6c99cce2ee1a79698ac56886cf9b282f1ef4aff4132bca9cc136b596cc14c493cf122e0edb5c6e50185a080d11
6
+ metadata.gz: c2997b9111453d11d8b8509ebf73ed2b677135012f38978f884227188c832c1d0ec100893f0e8835c8740b3d4ae096c4d4ff459055743f5098dba6709aea3c67
7
+ data.tar.gz: 93ec65251ddd31cede0c68c8be24731b1abef52ce2257d01bd94c8fb5d0d5c6a38aa48fa6a03f0be5a9fe29453ff31d06da2ce0eb44c1701bf53adf9e2086ba4
@@ -7,14 +7,20 @@ def autoscale(groupname, *args)
7
7
  include Capistrano::DSL
8
8
  include Elbas::AWS::AutoScaling
9
9
 
10
- autoscale_group = autoscaling.groups[groupname]
10
+ autoscale_group = autoscaling.groups[groupname]
11
+ running_instances = autoscale_group.ec2_instances.filter('instance-state-name', 'running')
12
+
11
13
  set :aws_autoscale_group, groupname
12
14
 
13
- autoscale_group.ec2_instances.filter('instance-state-name', 'running').each do |instance|
15
+ running_instances.each do |instance|
14
16
  hostname = instance.dns_name || instance.private_ip_address
15
17
  p "ELBAS: Adding server: #{hostname}"
16
18
  server(hostname, *args)
17
19
  end
18
20
 
19
- after('deploy', 'elbas:scale')
21
+ if running_instances.size > 0
22
+ after('deploy', 'elbas:scale')
23
+ else
24
+ p "ELBAS: AMI could not be created because no running instances were found. Is your autoscale group name correct?"
25
+ end
20
26
  end
@@ -1,3 +1,3 @@
1
1
  module Elbas
2
- VERSION = '0.12.0'
2
+ VERSION = '0.13.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: elbas
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.0
4
+ version: 0.13.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Logan Serman
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-02-24 00:00:00.000000000 Z
11
+ date: 2015-03-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -188,3 +188,4 @@ test_files:
188
188
  - spec/support/stubs/DescribeTags.200.xml
189
189
  - spec/support/stubs/UpdateAutoScalingGroup.200.xml
190
190
  - spec/support/stubs/security-credentials.200.json
191
+ has_rdoc: