bora 0.5.0 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 901afe63c123cadd7b17d88b366c08562c409be8
4
- data.tar.gz: 2c8fc06901e2b08b06963e5a40fcd80bafb2f4be
3
+ metadata.gz: e1619e3e4e231e87f3814cb08cc63f37492f2131
4
+ data.tar.gz: 25a29e25c975b0603ddcaf60cf34a0d1ccf97191
5
5
  SHA512:
6
- metadata.gz: 610ef15f8900ae1fefde24a898e11beb7443e82f20aecb89492615b000a41dc0534893987442e82d2a7efaf5def54efcf5d2677973e044e308bcdd257326b7b1
7
- data.tar.gz: 0ffffcd3bedc51a9ba1e246cb7546e4ff29f7c2d38ba5a92f82e779123e5767e886ec15f4895d04de8ce9cf5d501c6415c34717299033ac663e86de0cf5e1f22
6
+ metadata.gz: b849204fbd61285510d8572af88086fe945f5a02b615bda669481006fccbda14ec50b079257aead29724d1d2b51d7d2b7b971aacb216bea3e46beca4851f5697
7
+ data.tar.gz: cd57b6e5bb232da8876c00008d04fa9f3baf868791e322ea524b762e711404f4cc8ffd8301445014592828c887cc920224d44730cf8c5b35313e729534044fc2
@@ -7,6 +7,8 @@ require 'bora/output'
7
7
 
8
8
  module Bora
9
9
  class Stack
10
+ NO_UPDATE_MESSAGE = "No updates are to be performed"
11
+
10
12
  def initialize(stack_name)
11
13
  @stack_name = stack_name
12
14
  @cfn = Aws::CloudFormation::Client.new
@@ -95,7 +97,8 @@ module Bora
95
97
  @cfn.method("#{action.to_s.downcase}_stack").call(options)
96
98
  wait_for_completion(&block)
97
99
  rescue Aws::CloudFormation::Errors::ValidationError => e
98
- raise e unless e.message.include?("No updates are to be performed")
100
+ raise e unless e.message.include?(NO_UPDATE_MESSAGE)
101
+ return nil
99
102
  end
100
103
  (action == :delete && !underlying_stack) || status.success?
101
104
  end
@@ -38,11 +38,13 @@ module Bora
38
38
  within_namespace do
39
39
  desc "Creates (or updates) the '#{@stack_name}' stack"
40
40
  task :apply do
41
- invoke_action(@stack.exists? ? "update" : "create", @stack_options)
42
- outputs = @stack.outputs
43
- if outputs && outputs.length > 0
44
- puts "Stack outputs"
45
- outputs.each { |output| puts output }
41
+ success = invoke_action(@stack.exists? ? "update" : "create", @stack_options)
42
+ if success
43
+ outputs = @stack.outputs
44
+ if outputs && outputs.length > 0
45
+ puts "Stack outputs"
46
+ outputs.each { |output| puts output }
47
+ end
46
48
  end
47
49
  end
48
50
  end
@@ -156,8 +158,13 @@ module Bora
156
158
  if success
157
159
  puts "#{action.capitalize} stack '#{@stack_name}' completed successfully"
158
160
  else
159
- fail("#{action.capitalize} stack '#{@stack_name}' failed")
161
+ if success == nil
162
+ puts "#{action.capitalize} stack '#{@stack_name}' skipped as template has not changed"
163
+ else
164
+ fail("#{action.capitalize} stack '#{@stack_name}' failed")
165
+ end
160
166
  end
167
+ success
161
168
  end
162
169
 
163
170
  def within_namespace
@@ -1,3 +1,3 @@
1
1
  module Bora
2
- VERSION = "0.5.0"
2
+ VERSION = "0.5.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bora
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Charles Blaxland