stackster 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
data/README.md ADDED
@@ -0,0 +1,33 @@
1
+ I help deploy Stacks into Cloud Formation. I save data about them in SimpleDB.
2
+
3
+ Getting Started
4
+ ---------------
5
+
6
+ Install the gem
7
+
8
+ ```
9
+ gem install stackster
10
+ ```
11
+
12
+ Create a file **~/.stackster.yml** and include within it:
13
+
14
+ ```
15
+ access_key: xxx
16
+ secret_key: yyy
17
+ region: us-west-1
18
+ ```
19
+
20
+ Commands
21
+ --------
22
+
23
+ You can issues the following commands stacks:
24
+
25
+ ```
26
+ stackster list
27
+ stackster create -n STACK_NAME -a ATTRIBUTES -t TEMPLATE_PATH
28
+ stackster update -n STACK_NAME -a ATTRIBUTES
29
+ stackster show -n STACK_NAME
30
+ stackster destroy -n STACK_NAME
31
+ ```
32
+
33
+ For more information, run stackster -h.
@@ -12,12 +12,24 @@ module Stackster
12
12
  describe_instances.each do |instance|
13
13
  tag_set = instance['instancesSet'].first['tagSet']
14
14
  if tag_set['aws:cloudformation:stack-name']
15
- h << instance if tag_set['aws:cloudformation:stack-name'] == stack_name
15
+ if tag_set['aws:cloudformation:stack-name'] == stack_name
16
+ h << instance if instance_running? instance
17
+ end
16
18
  end
17
19
  end
18
20
  h
19
21
  end
20
22
 
23
+ private
24
+
25
+ def get_instance_state(instance_hash)
26
+ instance_hash['instancesSet'].first['instanceState']['name']
27
+ end
28
+
29
+ def instance_running?(instance_hash)
30
+ get_instance_state(instance_hash) == 'running'
31
+ end
32
+
21
33
  def describe_instances
22
34
  @ec2.describe_instances
23
35
  end
@@ -13,12 +13,14 @@ module Stackster
13
13
  'outputs' => stack_reader.outputs,
14
14
  'events' => stack_reader.events,
15
15
  'resources' => stack_reader.resources,
16
- 'instances' => instances_public_ip_addresses
16
+ 'instances' => instances_private_ip_addresses
17
17
  }
18
18
  end
19
19
 
20
- def instances_public_ip_addresses
21
- stack_reader.instances.map { |i| i['instancesSet'].first['ipAddress'] }
20
+ def instances_private_ip_addresses
21
+ stack_reader.instances.map do |i|
22
+ i['instancesSet'].first['privateIpAddress'] if i['instancesSet'].first['privateIpAddress']
23
+ end
22
24
  end
23
25
 
24
26
  def attribute_names
@@ -80,6 +80,10 @@ module Stackster
80
80
  stack_formater.instances_public_ip_addresses
81
81
  end
82
82
 
83
+ def instances_private_ip_addresses
84
+ stack_formater.instances_private_ip_addresses
85
+ end
86
+
83
87
  def resources
84
88
  stack_reader.resources
85
89
  end
@@ -1,3 +1,3 @@
1
1
  module Stackster
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stackster
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-06-21 00:00:00.000000000 Z
12
+ date: 2012-06-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
16
- requirement: &70263534272860 !ruby/object:Gem::Requirement
16
+ requirement: &70157233988800 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *70263534272860
24
+ version_requirements: *70157233988800
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: fog
27
- requirement: &70263534267300 !ruby/object:Gem::Requirement
27
+ requirement: &70157233987100 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70263534267300
35
+ version_requirements: *70157233987100
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: trollop
38
- requirement: &70263534265660 !ruby/object:Gem::Requirement
38
+ requirement: &70157233986600 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,7 +43,7 @@ dependencies:
43
43
  version: '0'
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *70263534265660
46
+ version_requirements: *70157233986600
47
47
  description: Thats what I do
48
48
  email:
49
49
  - brett@weav.net
@@ -55,6 +55,7 @@ files:
55
55
  - .gitignore
56
56
  - Gemfile
57
57
  - LICENSE
58
+ - README.md
58
59
  - Rakefile
59
60
  - bin/stackster
60
61
  - lib/stackster.rb
@@ -94,7 +95,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
94
95
  version: '0'
95
96
  segments:
96
97
  - 0
97
- hash: -1874082629842404909
98
+ hash: -1350487739952735544
98
99
  required_rubygems_version: !ruby/object:Gem::Requirement
99
100
  none: false
100
101
  requirements:
@@ -103,7 +104,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
103
104
  version: '0'
104
105
  segments:
105
106
  - 0
106
- hash: -1874082629842404909
107
+ hash: -1350487739952735544
107
108
  requirements: []
108
109
  rubyforge_project: stackster
109
110
  rubygems_version: 1.8.16