From 258fca669e2d7d3ed4cd9db63066bc2314547961 Mon Sep 17 00:00:00 2001 From: Dan Anglin Date: Sun, 24 Apr 2022 16:19:38 +0100 Subject: [PATCH] build: add Makefile --- Makefile | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..49f5f1c --- /dev/null +++ b/Makefile @@ -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