forked from scaleway/packer-plugin-scaleway
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGNUmakefile
43 lines (32 loc) · 1.35 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
39
40
41
42
43
NAME=scaleway
BINARY=packer-plugin-${NAME}
PLUGIN_FQN="$(shell grep -E '^module' <go.mod | sed -E 's/module *//')"
COUNT?=1
E2E_TEST?=$(shell go list ./internal/tests)
TEST?=$(filter-out $(E2E_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:
@go build -ldflags="-X '${PLUGIN_FQN}/version.VersionPrerelease=dev'" -o '${BINARY}'
packer plugins install --path ${BINARY} "$(shell echo "${PLUGIN_FQN}" | sed 's/packer-plugin-//')"
test:
@go test -race -count $(COUNT) $(TEST) -timeout=3m
e2e_test:
make -C e2e_tests test
install-packer-sdc: ## Install packer sofware 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
generate: install-packer-sdc
@go generate ./...
@if [ -d ".docs" ]; then rm -r ".docs"; fi
packer-sdc renderdocs -src "docs" -partials docs-partials/ -dst ".docs/"
@./.web-docs/scripts/compile-to-webdocs.sh "." ".docs" ".web-docs" "scaleway"
@rm -r ".docs"
# checkout the .docs folder for a preview of the docs
install-plugin:
@packer plugins install github.com/scaleway/scaleway