forked from public/stack
ready to apply
This commit is contained in:
parent
930d537a55
commit
268faa19b3
25
Makefile
25
Makefile
|
@ -6,6 +6,12 @@ REGION := sfo3
|
|||
ROOT_DIR := $(shell pwd)
|
||||
TERRAFORM := $(ROOT_DIR)/out/terraform
|
||||
|
||||
.DEFAULT_GOAL :=
|
||||
.PHONY: default
|
||||
default: \
|
||||
toolchain \
|
||||
apply
|
||||
|
||||
.PHONY:
|
||||
clean:
|
||||
rm -rf $(CACHE_DIR)
|
||||
|
@ -19,6 +25,12 @@ infra/backend/.terraform: \
|
|||
$(BACKEND_TF)
|
||||
env -C infra/backend $(TERRAFORM) init
|
||||
|
||||
infra/main/.terraform: \
|
||||
$(OUT_DIR)/terraform \
|
||||
$(BACKEND_TF)
|
||||
env -C infra/main $(TERRAFORM) init \
|
||||
-backend-config="../../config/$(ENVIRONMENT).tfbackend"
|
||||
|
||||
infra/backend/$(ENVIRONMENT).tfstate: \
|
||||
$(CACHE_DIR)/secrets/credentials.tfvars \
|
||||
$(OUT_DIR)/terraform \
|
||||
|
@ -33,14 +45,17 @@ infra/backend/$(ENVIRONMENT).tfstate: \
|
|||
config/$(ENVIRONMENT).tfbackend: \
|
||||
infra/backend/$(ENVIRONMENT).tfstate \
|
||||
$(OUT_DIR)/terraform
|
||||
env -C infra/backend $(TERRAFORM) output -state ../../$< > $@
|
||||
env -C infra/backend $(TERRAFORM) \
|
||||
output -state ../../$< \
|
||||
> $@
|
||||
|
||||
.PHONY:
|
||||
plan: \
|
||||
apply: \
|
||||
$(CACHE_DIR)/secrets/credentials.tfvars \
|
||||
config/$(ENVIRONMENT).tfbackend \
|
||||
$(OUT_DIR)/terraform
|
||||
env -C infra/main $(TERRAFORM) plan -var-file $<
|
||||
$(OUT_DIR)/terraform \
|
||||
infra/main/.terraform
|
||||
env -C infra/main $(TERRAFORM) apply \
|
||||
-var-file ../../$<
|
||||
|
||||
$(CACHE_DIR)/secrets:
|
||||
mkdir -p $@
|
||||
|
|
Loading…
Reference in New Issue