ignition/Makefile

34 lines
519 B
Makefile

.PHONY: \
all \
clean \
publish \
vm
.DEFAULT_GOAL := all
clean:
rm -f *.ign
define genrules
$(patsubst %.yaml,%.ign,$(1)): $(1) $$(shell sed -rn 's/.*local: (.*)/\1/p' $(1))
butane -d . $$< > $$@
all: $(patsubst %.yaml,%.ign,$(1))
endef
$(foreach t,$(wildcard *.yaml),$(eval $(call genrules,$(t))))
%.env: %.env.gpg
gpg2 --decrypt $< > $@
%.token: %.token.gpg
gpg2 --decrypt $< > $@
publish: \
nvr1.ign
rsync -rti $^ files.pyrocufflink.blue:public_html/
vm: \
$(VMNAME).ign
sh mkvm.sh $(VMNAME)