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 +4 -4
- data/lib/bora/stack.rb +4 -1
- data/lib/bora/tasks.rb +13 -6
- data/lib/bora/version.rb +1 -1
- metadata +1 -1
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA1:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: e1619e3e4e231e87f3814cb08cc63f37492f2131
         | 
| 4 | 
            +
              data.tar.gz: 25a29e25c975b0603ddcaf60cf34a0d1ccf97191
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: b849204fbd61285510d8572af88086fe945f5a02b615bda669481006fccbda14ec50b079257aead29724d1d2b51d7d2b7b971aacb216bea3e46beca4851f5697
         | 
| 7 | 
            +
              data.tar.gz: cd57b6e5bb232da8876c00008d04fa9f3baf868791e322ea524b762e711404f4cc8ffd8301445014592828c887cc920224d44730cf8c5b35313e729534044fc2
         | 
    
        data/lib/bora/stack.rb
    CHANGED
    
    | @@ -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?( | 
| 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
         | 
    
        data/lib/bora/tasks.rb
    CHANGED
    
    | @@ -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 | 
            -
                       | 
| 43 | 
            -
             | 
| 44 | 
            -
                         | 
| 45 | 
            -
             | 
| 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 | 
            -
                     | 
| 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
         | 
    
        data/lib/bora/version.rb
    CHANGED