Skip to content

Commit

Permalink
Clean up targets in make plan
Browse files Browse the repository at this point in the history
  • Loading branch information
jakubno committed Jan 7, 2025
1 parent 0596d56 commit de3decb
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ init:
plan:
@ printf "Planning Terraform for env: `tput setaf 2``tput bold`$(ENV)`tput sgr0`\n\n"
terraform fmt -recursive
$(tf_vars) terraform plan -out=.tfplan.$(ENV) -compact-warnings -detailed-exitcode $$(echo $(ALL_MODULES) | tr ' ' '\n' | awk '{print "-target=module." $$0 ""}' | xargs)
$(eval TARGET := $(shell echo $(ALL_MODULES) | tr ' ' '\n' | awk '{print "-target=module." $$0 ""}' | xargs))
$(tf_vars) terraform plan -out=.tfplan.$(ENV) -compact-warnings -detailed-exitcode $(TARGET)

.PHONY: apply
apply:
Expand All @@ -69,13 +70,14 @@ apply:
.PHONY: plan-without-jobs
plan-without-jobs:
@ printf "Planning Terraform for env: `tput setaf 2``tput bold`$(ENV)`tput sgr0`\n\n"
$(eval TARGET := $(shell echo $(ALL_MODULES) | tr ' ' '\n' | grep -v -e "nomad" | awk '{print "-target=module." $$0 ""}' | xargs))
$(tf_vars) \
terraform plan \
-out=.tfplan.$(ENV) \
-input=false \
-compact-warnings \
-parallelism=20 \
$$(echo $(ALL_MODULES) | tr ' ' '\n' | grep -v -e "nomad" | awk '{print "-target=module." $$0 ""}' | xargs)
$(TARGET)

.PHONY: destroy
destroy:
Expand Down

0 comments on commit de3decb

Please sign in to comment.