From f7de8aace488cdf9a372ab6fa7f93eb085677f86 Mon Sep 17 00:00:00 2001 From: Dom Del Nano Date: Sun, 12 Jun 2022 15:43:17 -0700 Subject: [PATCH] Add missing Makefile --- GNUmakefile | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 GNUmakefile diff --git a/GNUmakefile b/GNUmakefile new file mode 100644 index 0000000..98fba69 --- /dev/null +++ b/GNUmakefile @@ -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 ./...