Sha256: 4a4b16ea73729c75c14cfa263093cbc8569f760e60c55fbba00586f2598dcd74

Contents?: true

Size: 679 Bytes

Versions: 11

Compression:

Stored size: 679 Bytes

Contents

module Codebuild
  class Delete
    include AwsServices

    def initialize(options)
      @options = options
      @project_name = options[:project_name] || inferred_project_name
      @stack_name = options[:stack_name] || inferred_stack_name(@project_name)
    end

    def run
      message = "Deleted #{@stack_name} stack."
      if @options[:noop]
        puts "NOOP #{message}"
      else
        are_you_sure?(@stack_name, :delete)

        if stack_exists?(@stack_name)
          cfn.delete_stack(stack_name: @stack_name)
          puts message
        else
          puts "#{@stack_name.inspect} stack does not exist".color(:red)
        end
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
codebuild-0.6.7 lib/codebuild/delete.rb
codebuild-0.6.6 lib/codebuild/delete.rb
codebuild-0.6.5 lib/codebuild/delete.rb
codebuild-0.6.4 lib/codebuild/delete.rb
codebuild-0.6.3 lib/codebuild/delete.rb
codebuild-0.6.2 lib/codebuild/delete.rb
codebuild-0.6.1 lib/codebuild/delete.rb
codebuild-0.6.0 lib/codebuild/delete.rb
codebuild-0.5.0 lib/codebuild/delete.rb
codebuild-0.4.0 lib/codebuild/delete.rb
codebuild-0.3.0 lib/codebuild/delete.rb