-
Notifications
You must be signed in to change notification settings - Fork 26
/
Copy pathMakefile
28 lines (20 loc) · 782 Bytes
/
Makefile
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
default: build
NAME=amazon-ami-management
BINARY=packer-plugin-${NAME}
MOCK_VERSION?=$(shell go list -m github.com/golang/mock | cut -d " " -f2)
SDK_VERSION?=$(shell go list -m github.com/hashicorp/packer-plugin-sdk | cut -d " " -f2)
PLUGIN_FQN=$(shell grep -E '^module' <go.mod | sed -E 's/module \s*//')
deps:
go install github.com/golang/mock/mockgen@${MOCK_VERSION}
go install github.com/hashicorp/packer-plugin-sdk/cmd/packer-sdc@${SDK_VERSION}
generate: deps
go generate ./...
test: deps
go test ./...
build: test
go build -v
install: build
packer plugins install --path ${BINARY} "$(shell echo "${PLUGIN_FQN}" | sed 's/packer-plugin-//')"
plugin-check: deps build
packer-sdc plugin-check ${BINARY}
.PHONY: default deps generate test build install plugin-check