forked from russellcardullo/terraform-provider-pingdom
-
Notifications
You must be signed in to change notification settings - Fork 13
/
GNUmakefile
36 lines (27 loc) · 805 Bytes
/
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
GOOS := $(shell go env GOOS)
GOARCH := $(shell go env GOARCH)
TAG := $(shell git describe --abbrev=0 --tags)
TF_PLUGIN_PATH := $(HOME)/.terraform.d/plugins/$(GOOS)_$(GOARCH)
PLUGIN_NAME := terraform-provider-pingdom
default: build
build: mod
go build -o build/$(GOOS)_$(GOARCH)/$(PLUGIN_NAME)_$(TAG)
install: build
install -d $(TF_PLUGIN_PATH) && \
install build/$(GOOS)_$(GOARCH)/$(PLUGIN_NAME)_$(TAG) $(TF_PLUGIN_PATH)
lint:
golangci-lint run
test:
go test -v -cover ./...
clean:
rm -rf build/
build-linux: mod
@docker build -t build .
@docker run --detach --name build build
@docker cp build:/app/$(PLUGIN_NAME) ./build/linux_amd64/$(PLUGIN_NAME)_$(TAG)
@docker rm -f build
@docker rmi build
mod:
@go mod tidy
@go mod vendor
.PHONY: build install lint test clean build-linux mod