-
Notifications
You must be signed in to change notification settings - Fork 25
/
Makefile
39 lines (28 loc) · 962 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
29
30
31
32
33
34
35
36
37
38
39
LDFLAGS += -X main.version=$$(git describe --always --abbrev=40 --dirty)
TEST?=$$(go list ./... |grep -v 'vendor')
PKG_NAME=ironic
TERRAFORM_PLUGINS=$(HOME)/.terraform.d/plugins
GOPATH?=$$(go env GOPATH)
ifeq ("$(IRONIC_ENDPOINT)", "")
IRONIC_ENDPOINT := http://127.0.0.1:6385/
export IRONIC_ENDPOINT
endif
default: build
build:
go build -ldflags "${LDFLAGS}" -tags "${TAGS}"
install: default
mkdir -p ${TERRAFORM_PLUGINS}
mv terraform-provider-ironic ${TERRAFORM_PLUGINS}
fmt:
gofmt -s -d -e ./ironic
lint :$(GOPATH)/golangci-lint
GOLANGCI_LINT_CACHE=/tmp/golangci-lint-cache/ $(GOPATH)/golangci-lint run ironic
$(GOPATH)/golangci-lint:
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(GOPATH) v1.59.1
test:
go test -tags "${TAGS}" -v ./ironic
acceptance:
TF_ACC=true go test -tags "acceptance" -v ./ironic/...
clean:
rm -f terraform-provider-ironic
.PHONY: build install test fmt lint