lono-cfn 0.0.9 → 0.1.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: 2f3e597e125705a05cdcf0bf2d8d4cf77795b54a
4
- data.tar.gz: fd7451b7d7bbf196c6768da44e9bcbd1d1852817
3
+ metadata.gz: 2b769083a5eafc274765550bd3d69b95e05f8e4e
4
+ data.tar.gz: 7b810af1565e85e98f74e25d02631a6aaab8ba28
5
5
  SHA512:
6
- metadata.gz: 78662463e2e41e3bf24f1fe7bfca52e0971d8b455a74dd1e1359fcd14c7fe6217e61423e3940a72265fc7b3f16e5cb91edd4a6469be19a7c20ca8e6643661e88
7
- data.tar.gz: fbbae100549f6acee6c32e06f40a9a25e0541621a7e6daa4370feed974c6d56282dceee0b38b212e524b65337c647f08d50de8007001c328efff2b443e8f63bd
6
+ metadata.gz: 2b310191b6dd9d58dc8f6f1bc5d92d2c16092976ec23347ba9d455604d0f6616bb4e4a12a525f192fbedf6006fa980047a3f89117bf649f0c115842daf37d98f
7
+ data.tar.gz: c9d4f8dbd62aaa7cbb11fa0832ea27bf2d7520beb064236e75cc342767d0f3af5f7aa12dfcd4a9feaa78cbb8f04eefa0dea622add6dd36803777c63ebba47e24
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- lono-cfn (0.0.8)
4
+ lono-cfn (0.0.9)
5
5
  aws-sdk
6
6
  colorize
7
7
  hashie
@@ -20,13 +20,13 @@ GEM
20
20
  minitest (~> 5.1)
21
21
  thread_safe (~> 0.3, >= 0.3.4)
22
22
  tzinfo (~> 1.1)
23
- aws-sdk (2.9.14)
24
- aws-sdk-resources (= 2.9.14)
25
- aws-sdk-core (2.9.14)
23
+ aws-sdk (2.9.15)
24
+ aws-sdk-resources (= 2.9.15)
25
+ aws-sdk-core (2.9.15)
26
26
  aws-sigv4 (~> 1.0)
27
27
  jmespath (~> 1.0)
28
- aws-sdk-resources (2.9.14)
29
- aws-sdk-core (= 2.9.14)
28
+ aws-sdk-resources (2.9.15)
29
+ aws-sdk-core (= 2.9.15)
30
30
  aws-sigv4 (1.0.0)
31
31
  builder (3.2.3)
32
32
  byebug (9.0.6)
@@ -70,7 +70,7 @@ GEM
70
70
  rb-fsevent (~> 0.9, >= 0.9.4)
71
71
  rb-inotify (~> 0.9, >= 0.9.7)
72
72
  ruby_dep (~> 1.2)
73
- lono (0.5.2)
73
+ lono (1.0.0)
74
74
  colorize
75
75
  guard
76
76
  guard-cloudformation
data/lib/lono-cfn.rb CHANGED
@@ -1,6 +1,8 @@
1
1
  $:.unshift(File.expand_path("../", __FILE__))
2
2
  require "lono_cfn/version"
3
3
 
4
+ require "colorize"
5
+
4
6
  # use vendored lono-params
5
7
  $:.unshift(File.expand_path("../../vendor/lono-params/lib", __FILE__))
6
8
  require "lono-params"
@@ -13,9 +13,22 @@ module LonoCfn
13
13
  if @options[:noop]
14
14
  message = "NOOP #{message}"
15
15
  else
16
- cfn.delete_stack(stack_name: @stack_name)
16
+ if stack_exist?
17
+ cfn.delete_stack(stack_name: @stack_name)
18
+ puts message
19
+ else
20
+ puts "#{@stack_name.inspect} stack does not exist".colorize(:red)
21
+ end
22
+ end
23
+ end
24
+
25
+ def stack_exist?
26
+ begin
27
+ cfn.describe_stacks(stack_name: @stack_name)
28
+ true
29
+ rescue Aws::CloudFormation::Errors::ValidationError
30
+ false
17
31
  end
18
- puts message
19
32
  end
20
33
  end
21
34
  end
@@ -1,3 +1,3 @@
1
1
  module LonoCfn
2
- VERSION = "0.0.9"
2
+ VERSION = "0.1.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lono-cfn
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tung Nguyen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-05-04 00:00:00.000000000 Z
11
+ date: 2017-05-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor