]> git.immae.eu Git - github/fretlink/terraform-provider-mailgun.git/blame - GNUmakefile
Merge pull request #18 from paulrbr-fl/add-binary-release
[github/fretlink/terraform-provider-mailgun.git] / GNUmakefile
CommitLineData
e17f219a
AG
1TEST?=$$(go list ./... |grep -v 'vendor')
2GOFMT_FILES?=$$(find . -name '*.go' |grep -v vendor)
3PKG_NAME=mailgun
a1f9b9a1 4WEBSITE_REPO=github.com/hashicorp/terraform-website
e17f219a
AG
5
6default: build
7
8build: fmtcheck
9 go install
10
11test: fmtcheck
12 go test -i $(TEST) || exit 1
13 echo $(TEST) | \
14 xargs -t -n4 go test $(TESTARGS) -timeout=30s -parallel=4
15
16testacc: fmtcheck
17 TF_ACC=1 go test $(TEST) -v $(TESTARGS) -timeout 120m
18
19vet:
20 @echo "go vet ."
21 @go vet $$(go list ./... | grep -v vendor/) ; if [ $$? -eq 1 ]; then \
22 echo ""; \
23 echo "Vet found suspicious constructs. Please check the reported constructs"; \
24 echo "and fix them if necessary before submitting the code for review."; \
25 exit 1; \
26 fi
27
065bf5d7
AG
28shellcheck:
29 shellcheck scripts/*
30
e17f219a
AG
31fmt:
32 gofmt -w $(GOFMT_FILES)
33
34fmtcheck:
35 @sh -c "'$(CURDIR)/scripts/gofmtcheck.sh'"
36
37errcheck:
38 @sh -c "'$(CURDIR)/scripts/errcheck.sh'"
39
40
41test-compile:
42 @if [ "$(TEST)" = "./..." ]; then \
43 echo "ERROR: Set TEST to a specific package. For example,"; \
44 echo " make test-compile TEST=./$(PKG_NAME)"; \
45 exit 1; \
46 fi
47 go test -c $(TEST) $(TESTARGS)
48
87e93609
AG
49website-githubpages:
50 bash scripts/launch-website.sh
7cbb92ef 51
a1f9b9a1
AG
52website:
53ifeq (,$(wildcard $(GOPATH)/src/$(WEBSITE_REPO)))
54 echo "$(WEBSITE_REPO) not found in your GOPATH (necessary for layouts and assets), get-ting..."
55 git clone https://$(WEBSITE_REPO) $(GOPATH)/src/$(WEBSITE_REPO)
56endif
57 @$(MAKE) -C $(GOPATH)/src/$(WEBSITE_REPO) website-provider PROVIDER_PATH=$(shell pwd) PROVIDER_NAME=$(PKG_NAME)
58
59website-test:
60ifeq (,$(wildcard $(GOPATH)/src/$(WEBSITE_REPO)))
61 echo "$(WEBSITE_REPO) not found in your GOPATH (necessary for layouts and assets), get-ting..."
62 git clone https://$(WEBSITE_REPO) $(GOPATH)/src/$(WEBSITE_REPO)
63endif
64 @$(MAKE) -C $(GOPATH)/src/$(WEBSITE_REPO) website-provider-test PROVIDER_PATH=$(shell pwd) PROVIDER_NAME=$(PKG_NAME)
65
1e4cb933 66.PHONY: build test testacc vet fmt fmtcheck errcheck test-compile website website-test website-githubpages
a1f9b9a1 67