feat: use digest to keep track of state of tools image
This commit is contained in:
parent
e757eb9363
commit
b71f711b3f
22
Makefile
22
Makefile
|
@ -1,3 +1,6 @@
|
||||||
|
# If using QubesOS, the smart card must be connected directly to the qube,
|
||||||
|
# rather than using a 'vault' qube.
|
||||||
|
|
||||||
BACKEND_TF := $(wildcard infra/backend/*.tf)
|
BACKEND_TF := $(wildcard infra/backend/*.tf)
|
||||||
MAIN_TF := $(wildcard infra/main/*.tf)
|
MAIN_TF := $(wildcard infra/main/*.tf)
|
||||||
ENVIRONMENT := production
|
ENVIRONMENT := production
|
||||||
|
@ -29,16 +32,14 @@ clean:
|
||||||
update-tools:
|
update-tools:
|
||||||
./src/make/update.sh
|
./src/make/update.sh
|
||||||
|
|
||||||
|
.PHONY: shell
|
||||||
|
shell: out/tools-image.digest
|
||||||
|
$(call run-container, -v ./secrets:/secrets, $(shell cat $<))
|
||||||
|
|
||||||
.PHONY: credentials
|
.PHONY: credentials
|
||||||
credentials: \
|
credentials: \
|
||||||
$(CACHE_DIR)/secrets/credentials.tfvars
|
$(CACHE_DIR)/secrets/credentials.tfvars
|
||||||
|
|
||||||
# If using QubesOS, the smart card must be connected directly to the qube,
|
|
||||||
# rather than using a 'vault' qube.
|
|
||||||
.PHONY:
|
|
||||||
shell: build-container
|
|
||||||
$(call run-container, -v ./secrets:/secrets)
|
|
||||||
|
|
||||||
$(KEY_DIR)/%.asc:
|
$(KEY_DIR)/%.asc:
|
||||||
$(call fetch_pgp_key,$(basename $(notdir $@)))
|
$(call fetch_pgp_key,$(basename $(notdir $@)))
|
||||||
|
|
||||||
|
@ -129,9 +130,8 @@ config/$(ENVIRONMENT).tfbackend: | \
|
||||||
-state $(ENVIRONMENT).tfstate \
|
-state $(ENVIRONMENT).tfstate \
|
||||||
'
|
'
|
||||||
|
|
||||||
.PHONY: build-container
|
out/tools-image.digest: Containerfile.tools | out
|
||||||
build-container:
|
docker build -f Containerfile.tools -q . > $@
|
||||||
docker build -t git.distrust.co/public/stack-tools -f Containerfile.tools .
|
|
||||||
|
|
||||||
GPG_TTY ?= $(shell tty)
|
GPG_TTY ?= $(shell tty)
|
||||||
|
|
||||||
|
@ -140,11 +140,11 @@ define run-container
|
||||||
-e GPG_TTY="$(GPG_TTY)" \
|
-e GPG_TTY="$(GPG_TTY)" \
|
||||||
-v $(shell gpgconf --list-dirs agent-socket):/root/.gnupg/S.gpg-agent:ro \
|
-v $(shell gpgconf --list-dirs agent-socket):/root/.gnupg/S.gpg-agent:ro \
|
||||||
-v $(shell gpgconf --list-dirs homedir):/root/.gnupg:rw \
|
-v $(shell gpgconf --list-dirs homedir):/root/.gnupg:rw \
|
||||||
git.distrust.co/public/stack-tools
|
$(2)
|
||||||
endef
|
endef
|
||||||
|
|
||||||
.PHONY: new-apply
|
.PHONY: new-apply
|
||||||
new-apply: build-container
|
new-apply: out/tools-image.digest
|
||||||
$(call run-container,'\
|
$(call run-container,'\
|
||||||
echo $$GPG_AGENT_INFO; \
|
echo $$GPG_AGENT_INFO; \
|
||||||
ls -l /S.gpg-agent; \
|
ls -l /S.gpg-agent; \
|
||||||
|
|
Loading…
Reference in New Issue