Add missing Makefile

This commit is contained in:
Dom Del Nano 2022-06-12 15:43:17 -07:00
parent 1e35a0da41
commit f7de8aace4

34
GNUmakefile Normal file
View File

@ -0,0 +1,34 @@
NAME=xenserver
BINARY=packer-plugin-${NAME}
COUNT?=1
TEST?=$(shell go list ./...)
HASHICORP_PACKER_PLUGIN_SDK_VERSION?=$(shell go list -m github.com/hashicorp/packer-plugin-sdk | cut -d " " -f2)
.PHONY: dev
build:
@go build -o ${BINARY}
dev: build
@mkdir -p ~/.packer.d/plugins/
@mv ${BINARY} ~/.packer.d/plugins/${BINARY}
test:
@go test -race -count $(COUNT) $(TEST) -timeout=3m
install-packer-sdc: ## Install packer sofware development command
@go install github.com/hashicorp/packer-plugin-sdk/cmd/packer-sdc@${HASHICORP_PACKER_PLUGIN_SDK_VERSION}
ci-release-docs: install-packer-sdc
@packer-sdc renderdocs -src docs -partials docs-partials/ -dst docs/
@/bin/sh -c "[ -d docs ] && zip -r docs.zip docs/"
plugin-check: install-packer-sdc build
@packer-sdc plugin-check ${BINARY}
testacc: dev
@PACKER_ACC=1 go test -count $(COUNT) -v $(TEST) -timeout=120m
generate: install-packer-sdc
@go generate ./...