1
0
Fork 0

fix all of ryans problems

This commit is contained in:
Lance Vick 2023-04-13 20:47:41 -07:00
parent fc8903f688
commit bf7262e8ba
Signed by: lrvick
GPG Key ID: 8E47A1EC35A1551D
1 changed files with 11 additions and 8 deletions

View File

@ -11,14 +11,15 @@ KEYS := \
88823A75ECAA786B0FF38B148E401478A3FBEF72 \
3D7C8D39E8C4DF771583D3F0A8A091FD346001CA
ifeq ("$(wildcard $(CACHE_DIR)/secrets/$(ENVIRONMENT).env)","")
gpg --decrypt \
secrets/$(ENVIRONMENT).env.gpg \
> $(CACHE_DIR)/secrets/$(ENVIRONMENT).env
SKIP_SECRETS=
ifeq ("$(wildcard $(CACHE_DIR)/secrets/$(ENVIRONMENT).env)$(SKIP_SECRETS)","")
noop=$(shell \
$(MAKE) SKIP_SECRETS=1 $(CACHE_DIR)/secrets/$(ENVIRONMENT).env \
)
endif
include $(CACHE_DIR)/secrets/$(ENVIRONMENT).env
export $(shell sed 's/=.*//' $(CACHE_DIR)/secrets/$(ENVIRONMENT).env)
export $(shell sed 's/=.*//' $(CACHE_DIR)/secrets/$(ENVIRONMENT).env 2>/dev/null)
.DEFAULT_GOAL :=
.PHONY: default
@ -67,9 +68,10 @@ infra/backend/$(ENVIRONMENT).tfstate: \
-var region=$(REGION) \
-state ../../$@
config/$(ENVIRONMENT).tfbackend: | \
infra/backend/$(ENVIRONMENT).tfstate \
config/$(ENVIRONMENT).tfbackend: \
$(OUT_DIR)/terraform
# File is not committed and this has no shared state
$(MAKE) infra/backend/$(ENVIRONMENT).tfstate
env -C infra/backend $(TERRAFORM) \
output -state ../../$< \
> $@
@ -87,7 +89,8 @@ $(CACHE_DIR)/secrets:
mkdir -p $@
$(CACHE_DIR)/secrets/%.env: secrets/%.env.gpg $(CACHE_DIR)/secrets
gpg --decrypt $< > $@
@echo "Decrypting $@"
gpg --decrypt $< 2>/dev/null > $@
$(FETCH_DIR)/terraform:
$(call git_clone,$@,$(TERRAFORM_REPO),$(TERRAFORM_REF))