Sha256: 9d989071eb9503e4d55a5e1b01cab43770ebcf93a0f907753084439d1b07fd7e

Contents?: true

Size: 780 Bytes

Versions: 4

Compression:

Stored size: 780 Bytes

Contents

require 'securerandom'

class Terraspace::CLI
  class Up < Base
    include TfcConcern
    include Concerns::PlanPath

    def run
      build
      if @options[:yes] && !@options[:plan] && !tfc?
        if Terraspace.cloud? && !@options[:plan]
          @options[:plan] = plan_path # for terraform apply
          @options[:out] = plan_path  # for terraform plan
        end
        Commander.new("plan", @options).run
        return unless File.exist?(plan_path) if Terraspace.cloud? # happens if plan fails
        Commander.new("apply", @options).run
      else
        Commander.new("apply", @options).run
      end
    end

  private
    # must build to compute tfc?
    def build
      Terraspace::Builder.new(@options).run
      @options[:build] = false
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
terraspace-2.0.3 lib/terraspace/cli/up.rb
terraspace-2.0.2 lib/terraspace/cli/up.rb
terraspace-2.0.1 lib/terraspace/cli/up.rb
terraspace-2.0.0 lib/terraspace/cli/up.rb