feat: add plan command

This commit is contained in:
Anton Livaja 2025-05-12 13:29:35 -07:00
parent b71f711b3f
commit 32697576a0
Signed by: anton
GPG Key ID: 44A86CFF1FDF0E85
2 changed files with 15 additions and 3 deletions

View File

@ -43,4 +43,3 @@ COPY --from=user-k9s . /
RUN mkdir -p /root/.gnupg
RUN chmod 0700 /root/.gnupg
ENTRYPOINT ["/bin/sh"]

View File

@ -34,7 +34,7 @@ update-tools:
.PHONY: shell
shell: out/tools-image.digest
$(call run-container, -v ./secrets:/secrets, $(shell cat $<))
$(call run-container, -v ./secrets:/secrets, $(shell cat $<), bin/sh)
.PHONY: credentials
credentials: \
@ -140,9 +140,22 @@ define run-container
-e GPG_TTY="$(GPG_TTY)" \
-v $(shell gpgconf --list-dirs agent-socket):/root/.gnupg/S.gpg-agent:ro \
-v $(shell gpgconf --list-dirs homedir):/root/.gnupg:rw \
$(2)
$(2) \
$(3)
endef
.PHONY: plan
plan: out/tools-image.digest
$(call run-container, \
-v $(PWD)/secrets:/secrets -v $(PWD)/infra:/infra, \
$(shell cat $<), \
sops exec-env /secrets/$(ENVIRONMENT).enc.env -- \
'tofu -chdir=/infra/main plan \
-var environment=$(ENVIRONMENT) \
-var namespace=$(ENVIRONMENT) \
-var region=$(REGION)' \
)
.PHONY: new-apply
new-apply: out/tools-image.digest
$(call run-container,'\