Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
jooola committed Nov 2, 2023
1 parent df4d69a commit 301ccbd
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions GNUmakefile
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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 ./...
Expand Down

0 comments on commit 301ccbd

Please sign in to comment.