Class: Terraspace::Compiler::Perform
- Inherits:
-
Object
- Object
- Terraspace::Compiler::Perform
- Includes:
- Basename, CommandsConcern
- Defined in:
- lib/terraspace/compiler/perform.rb,
lib/terraspace/compiler/perform/skip.rb
Defined Under Namespace
Classes: Skip
Instance Method Summary collapse
- #compile ⇒ Object
-
#compile_config ⇒ Object
compile common config files: provider and backend for the root module.
- #compile_module ⇒ Object
- #compile_tfvars(write: true) ⇒ Object
-
#initialize(mod, options = {}) ⇒ Perform
constructor
A new instance of Perform.
Methods included from Basename
Methods included from CommandsConcern
Constructor Details
#initialize(mod, options = {}) ⇒ Perform
Returns a new instance of Perform.
6 7 8 9 |
# File 'lib/terraspace/compiler/perform.rb', line 6 def initialize(mod, ={}) # options for type_dir @mod, @options = mod, end |
Instance Method Details
#compile ⇒ Object
11 12 13 14 15 |
# File 'lib/terraspace/compiler/perform.rb', line 11 def compile compile_config compile_module if @mod.resolved compile_tfvars end |
#compile_config ⇒ Object
compile common config files: provider and backend for the root module
18 19 20 21 |
# File 'lib/terraspace/compiler/perform.rb', line 18 def compile_config return unless compile? compile_config_terraform end |
#compile_module ⇒ Object
23 24 25 26 27 28 29 30 |
# File 'lib/terraspace/compiler/perform.rb', line 23 def compile_module with_mod_file do |src_path| # Skip examples. Dont want to process tfvars <%= output(...) %> which triggers dependency graph # Also a speed improvement. next if src_path.include?("#{@mod.root}/examples/") compile_mod_file(src_path) end end |
#compile_tfvars(write: true) ⇒ Object
32 33 34 35 36 |
# File 'lib/terraspace/compiler/perform.rb', line 32 def compile_tfvars(write: true) return unless compile? return if command_is?(:seed) # avoid dependencies being built and erroring when backend bucket doesnt exist Strategy::Tfvar.new(@mod).run(write: write) # writer within Strategy to control file ordering end |