Sha256: 77a1b1c4fa719d3c680f708a26af3757b6ba76f904fe759d966201f106d4f6d5

Contents?: true

Size: 607 Bytes

Versions: 4

Compression:

Stored size: 607 Bytes

Contents

class Lono::Cfn::Deploy
  class Operable < Base
    def check!
      status = stack_status
      unless status =~ /_COMPLETE$/ || status == "UPDATE_ROLLBACK_FAILED"
        logger.info "Cannot create run operation on stack #{@stack} is not in an updatable state.  Stack status: #{status}".color(:red)
        quit 1
      end
    end

    # All CloudFormation states listed here:
    # http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-describing-stacks.html
    def stack_status
      resp = cfn.describe_stacks(stack_name: @stack)
      resp.stacks[0].stack_status
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
lono-8.0.0.pre.rc4 lib/lono/cfn/deploy/operable.rb
lono-8.0.0.pre.rc3 lib/lono/cfn/deploy/operable.rb
lono-8.0.0.pre.rc2 lib/lono/cfn/deploy/operable.rb
lono-8.0.0.pre.rc1 lib/lono/cfn/deploy/operable.rb