cloudformer 0.0.8 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cloudformer/stack.rb +9 -5
- data/lib/cloudformer/tasks.rb +15 -1
- data/lib/cloudformer/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 289a320634a41ab510b37f23a1dd7cf4c04b7391
|
4
|
+
data.tar.gz: 2df569065ea2baf119783de9acc699142271c434
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6377c44e2e86cd82cf66c1c4add321900ccdba3ed5e0c93d5147f5a00d60688961bc2038812e3e748ece07f2eeef5b29792e4e802ecac1210f4132bcf07f6853
|
7
|
+
data.tar.gz: 6eb0794016c19afff9a5e485aa3594114f072723cd2b1ae699f790e11e39caee11ea6ae8ce18b3486830d57d05f706db2584766e87dc3ff6a0f8b02af8d2c88c
|
data/lib/cloudformer/stack.rb
CHANGED
@@ -27,7 +27,7 @@ class Stack
|
|
27
27
|
pending_operations = create(template, parameters, disable_rollback, capabilities)
|
28
28
|
end
|
29
29
|
wait_until_end if pending_operations
|
30
|
-
if stack.status == "ROLLBACK_COMPLETE"
|
30
|
+
if stack.status == "ROLLBACK_COMPLETE" || stack.status == "CREATE_FAILED"
|
31
31
|
puts "Unable to update template. Check log for more information."
|
32
32
|
return 1
|
33
33
|
else
|
@@ -159,10 +159,14 @@ class Stack
|
|
159
159
|
puts "Attempting to #{action} all ec2 instances in the stack #{stack.name}"
|
160
160
|
return "Stack not up" if !deployed
|
161
161
|
stack.resources.each do |resource|
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
162
|
+
begin
|
163
|
+
next if resource.resource_type != "AWS::EC2::Instance"
|
164
|
+
physical_resource_id = resource.physical_resource_id
|
165
|
+
puts "Attempting to #{action} Instance with physical_resource_id: #{physical_resource_id}"
|
166
|
+
@ec2.instances[physical_resource_id].send(action)
|
167
|
+
rescue
|
168
|
+
puts "Some resources are not up."
|
169
|
+
end
|
166
170
|
end
|
167
171
|
end
|
168
172
|
end
|
data/lib/cloudformer/tasks.rb
CHANGED
@@ -20,6 +20,7 @@ module Cloudformer
|
|
20
20
|
define_create_task
|
21
21
|
define_validate_task
|
22
22
|
define_delete_task
|
23
|
+
define_delete_with_stop_task
|
23
24
|
define_events_task
|
24
25
|
define_status_task
|
25
26
|
define_outputs_task
|
@@ -34,7 +35,7 @@ module Cloudformer
|
|
34
35
|
if retry_delete
|
35
36
|
@stack.delete
|
36
37
|
end
|
37
|
-
@stack.apply(template, parameters, disable_rollback, capabilities)
|
38
|
+
exit @stack.apply(template, parameters, disable_rollback, capabilities)
|
38
39
|
end
|
39
40
|
end
|
40
41
|
def define_delete_task
|
@@ -47,6 +48,19 @@ module Cloudformer
|
|
47
48
|
end
|
48
49
|
end
|
49
50
|
end
|
51
|
+
|
52
|
+
def define_delete_with_stop_task
|
53
|
+
desc "Delete stack after stopping all instances"
|
54
|
+
task :force_delete do
|
55
|
+
begin
|
56
|
+
@stack.stop_instances
|
57
|
+
@stack.delete
|
58
|
+
rescue => e
|
59
|
+
puts "Stack delete message - #{e.message}"
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
50
64
|
def define_status_task
|
51
65
|
desc "Get the deployed app status."
|
52
66
|
task :status do
|
data/lib/cloudformer/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cloudformer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Arvind Kunday
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-11-
|
11
|
+
date: 2013-11-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|