Class: Terraspace::CLI::New::Stack

Inherits:
Sequence
  • Object
show all
Defined in:
lib/terraspace/cli/new/stack.rb

Instance Method Summary collapse

Methods inherited from Sequence

base_options, component_options

Instance Method Details

#create_stackObject



7
8
9
10
11
12
13
14
# File 'lib/terraspace/cli/new/stack.rb', line 7

def create_stack
  plugin_template_source(@options[:lang], "stack") # IE: plugin_template_source("hcl", "stack")

  puts "=> Creating new stack called #{name}."
  dest = "app/stacks/#{name}"
  dest = "#{@options[:project_name]}/#{dest}" if @options[:project_name]
  directory ".", dest
end

#create_testObject



16
17
18
# File 'lib/terraspace/cli/new/stack.rb', line 16

def create_test
  Test::Project.start(component_args(name, @options[:project_name]))
end

#run_generator_hook_scriptObject



20
21
22
23
24
# File 'lib/terraspace/cli/new/stack.rb', line 20

def run_generator_hook_script
  script = ENV['TS_GENERATOR_STACK']
  return unless script
  run_script(script, "app/stacks/#{name}")
end