generated from hashicorp/packer-plugin-scaffolding
-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathGNUmakefile
38 lines (29 loc) · 1.11 KB
/
GNUmakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
NAME=hcloud
BINARY=packer-plugin-$(NAME)
ifeq ($(OS), Windows_NT)
# Prevent "Ignoring plugin match packer-plugin-hcloud, no exe extension"
BINARY=packer-plugin-$(NAME).exe
endif
FQN=$(shell go list | sed 's/packer-plugin-//')
COUNT?=1
TEST?=./...
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
packer plugins install --path $(BINARY) $(FQN)
test:
go test -race -count $(COUNT) -v $(TEST) -timeout=3m -coverprofile=coverage.txt
install-packer-sdc: ## Install packer software development command
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)
testacc: dev
PACKER_ACC=1 go test -count $(COUNT) -v $(TEST) -timeout=120m -coverprofile=coverage.txt
generate: install-packer-sdc
go generate ./...
rm -rf .docs
packer-sdc renderdocs -src "docs" -partials docs-partials/ -dst ".docs/"
./.web-docs/scripts/compile-to-webdocs.sh "." ".docs" ".web-docs" "hashicorp"
rm -r ".docs"