Skip to content

Commit

Permalink
Merge pull request #67 from boltops-tools/build-config-terraform-fix
Browse files Browse the repository at this point in the history
fix find placeholder stack so config/terraform only builds for stacks
  • Loading branch information
tongueroo authored Dec 4, 2020
2 parents dc9f802 + bddac97 commit 7faaf04
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions lib/terraspace/cli/build/placeholder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,17 @@ def build
mod = @options[:mod]
if !mod or %w[placeholder].include?(mod)
logger.info "Building one of the modules to get backend.tf info"
mod = find_mod
mod = find_stack
end
Terraspace::Builder.new(@options.merge(mod: mod, init: false)).run # generate and init
Terraspace::Mod.new(mod, @options) # mod metadata
end

# Used by: terraspace build placeholder
def find_mod
mod_path = Dir.glob("{app,vendor}/{modules,stacks}/*").last
def find_stack
mod_path = Dir.glob("{app,vendor}/{stacks}/*").last
unless mod_path
logger.info "No modules or stacks found."
logger.info "No stacks found."
exit 0
end
File.basename(mod_path) # mod name
Expand Down
2 changes: 1 addition & 1 deletion lib/terraspace/mod.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def initialize(name, options={})

def placeholder(name)
if name == "placeholder"
Terraspace::CLI::Build::Placeholder.new(@options).find_mod
Terraspace::CLI::Build::Placeholder.new(@options).find_stack
else
name
end
Expand Down

0 comments on commit 7faaf04

Please # to comment.