From 301ccbd0c4141ce330618586df736fa86a8d7ea6 Mon Sep 17 00:00:00 2001 From: jo Date: Thu, 2 Nov 2023 16:05:56 +0100 Subject: [PATCH] wip --- GNUmakefile | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/GNUmakefile b/GNUmakefile index 492c857e..1513345b 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -1,11 +1,10 @@ NAME=hcloud +BINARY=packer-plugin-$(NAME) +PACKER_PLUGIN_PATH=~/.config/packer/plugins ifeq ($(OS), Windows_NT) - BINARY?=packer-plugin-${NAME}.exe - PACKER_PLUGIN_PATH?=%APPDATA%\packer.d\plugins -else - BINARY?=packer-plugin-${NAME} - PACKER_PLUGIN_PATH?=~/.config/packer/plugins +BINARY=packer-plugin-$(NAME).exe +PACKER_PLUGIN_PATH=%APPDATA%\packer.d\plugins endif COUNT?=1 @@ -15,24 +14,23 @@ HASHICORP_PACKER_PLUGIN_SDK_VERSION?=$(shell go list -m github.com/hashicorp/pac .PHONY: dev build: - go build -o ${BINARY} + go build -o $(BINARY) dev: build - mkdir -p ${PACKER_PLUGIN_PATH} - mv ${BINARY} ${PACKER_PLUGIN_PATH} - ls ${PACKER_PLUGIN_PATH} + mkdir -p $(PACKER_PLUGIN_PATH) + mv $(BINARY) $(PACKER_PLUGIN_PATH) test: go test -race -count $(COUNT) -v $(TEST) -timeout=3m install-packer-sdc: ## Install packer software development command - go install github.com/hashicorp/packer-plugin-sdk/cmd/packer-sdc@${HASHICORP_PACKER_PLUGIN_SDK_VERSION} + go install github.com/hashicorp/packer-plugin-sdk/cmd/packer-sdc@$(HASHICORP_PACKER_PLUGIN_SDK_VERSION) plugin-check: install-packer-sdc build - packer-sdc plugin-check ${BINARY} + packer-sdc plugin-check $(BINARY) testacc: dev - PACKER_ACC=1 PACKER_PLUGIN_PATH=${PACKER_PLUGIN_PATH} go test -count $(COUNT) -v $(TEST) -timeout=120m -tags=acceptance + PACKER_ACC=1 PACKER_PLUGIN_PATH=$(PACKER_PLUGIN_PATH) go test -count $(COUNT) -v $(TEST) -timeout=120m -tags=acceptance generate: install-packer-sdc go generate ./...