Sha256: 2e798e1a859b04f8cb395f87691171b05523bfda9fd64cd8fd5b217224ffd402

Contents?: true

Size: 791 Bytes

Versions: 4

Compression:

Stored size: 791 Bytes

Contents

class Lono::Cfn::Plan
  class Template < Base
    def run
      return unless Lono.config.plan.template
      @build.all
      logger.info "Template Changes:".color(:green)
      download_existing_cfn_template
      diff = Diff::File.new(mode: Lono.config.plan.template)
      diff.show(existing_template_path, new_cfn_template)
      logger.info "" # newline
    end

    def download_existing_cfn_template
      resp = cfn.get_template(stack_name: @stack, template_stage: "Original")
      FileUtils.mkdir_p(File.dirname(existing_template_path))
      IO.write(existing_template_path, resp.template_body)
    end

    # for clarity
    def new_cfn_template
      @blueprint.output_path
    end

    def existing_template_path
      "/tmp/lono/diff/template/existing.yml"
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
lono-8.0.0.pre.rc6 lib/lono/cfn/plan/template.rb
lono-8.0.0.pre.rc5 lib/lono/cfn/plan/template.rb
lono-8.0.0.pre.rc4 lib/lono/cfn/plan/template.rb
lono-8.0.0.pre.rc3 lib/lono/cfn/plan/template.rb