build: add Makefile
This commit is contained in:
parent
9dc8490404
commit
258fca669e
1 changed files with 18 additions and 0 deletions
18
Makefile
Normal file
18
Makefile
Normal 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
|
Reference in a new issue