build: add Makefile

This commit is contained in:
Dan Anglin 2022-04-24 16:19:38 +01:00
parent 9dc8490404
commit 258fca669e
Signed by: dananglin
GPG key ID: 0C1D44CFBEE68638

18
Makefile Normal file
View file

@ -0,0 +1,18 @@
IMAGE_TYPE ?= lxd
BUILD_DIR = ./build
.PHONY: json
json:
@jsonnet --ext-str type="$(IMAGE_TYPE)" -o $(BUILD_DIR)/image.pkr.json main.jsonnet
.PHONY: build
build: validate
@packer build $(BUILD_DIR)
.PHONY: validate
validate: json
@packer validate $(BUILD_DIR)
.PHONY: clean
clean:
@find ./build -type f -not -iname .gitkeep | xargs rm -f