2017-06-05 20:54:03 +00:00
|
|
|
TEST?=$$(go list ./... |grep -v 'vendor')
|
2018-04-27 15:57:41 +00:00
|
|
|
WEBSITE_REPO=github.com/hashicorp/terraform-website
|
|
|
|
PKG_NAME=google
|
2017-06-05 20:54:03 +00:00
|
|
|
|
|
|
|
default: build
|
|
|
|
|
|
|
|
build: fmtcheck
|
|
|
|
go install
|
|
|
|
|
2017-06-06 20:27:28 +00:00
|
|
|
test: fmtcheck
|
2017-06-05 20:54:03 +00:00
|
|
|
go test -i $(TEST) || exit 1
|
|
|
|
echo $(TEST) | \
|
|
|
|
xargs -t -n4 go test $(TESTARGS) -timeout=30s -parallel=4
|
|
|
|
|
|
|
|
testacc: fmtcheck
|
2018-11-09 23:13:18 +00:00
|
|
|
TF_ACC=1 TF_SCHEMA_PANIC_ON_ERROR=1 go test $(TEST) -v $(TESTARGS) -timeout 120m -ldflags="-X=github.com/terraform-providers/terraform-provider-google/version.ProviderVersion=acc"
|
2017-06-05 20:54:03 +00:00
|
|
|
|
|
|
|
fmt:
|
2018-12-11 21:30:47 +00:00
|
|
|
@echo "==> Fixing source code with gofmt..."
|
|
|
|
gofmt -w ./$(PKG_NAME)
|
2017-06-05 20:54:03 +00:00
|
|
|
|
2018-12-11 21:30:47 +00:00
|
|
|
# Currently required by tf-deploy compile
|
2017-06-05 20:54:03 +00:00
|
|
|
fmtcheck:
|
|
|
|
@sh -c "'$(CURDIR)/scripts/gofmtcheck.sh'"
|
|
|
|
|
2018-12-11 21:30:47 +00:00
|
|
|
lint:
|
|
|
|
@echo "==> Checking source code against linters..."
|
|
|
|
@gometalinter ./$(PKG_NAME)
|
|
|
|
tools:
|
|
|
|
@echo "==> installing required tooling..."
|
|
|
|
go get -u github.com/kardianos/govendor
|
|
|
|
go get -u github.com/alecthomas/gometalinter
|
|
|
|
gometalinter --install
|
2017-06-05 20:54:03 +00:00
|
|
|
|
2017-06-30 08:16:10 +00:00
|
|
|
test-compile:
|
|
|
|
@if [ "$(TEST)" = "./..." ]; then \
|
|
|
|
echo "ERROR: Set TEST to a specific package. For example,"; \
|
2018-04-27 15:57:41 +00:00
|
|
|
echo " make test-compile TEST=./$(PKG_NAME)"; \
|
2017-06-30 08:16:10 +00:00
|
|
|
exit 1; \
|
|
|
|
fi
|
|
|
|
go test -c $(TEST) $(TESTARGS)
|
|
|
|
|
2018-04-27 15:57:41 +00:00
|
|
|
website:
|
|
|
|
ifeq (,$(wildcard $(GOPATH)/src/$(WEBSITE_REPO)))
|
|
|
|
echo "$(WEBSITE_REPO) not found in your GOPATH (necessary for layouts and assets), get-ting..."
|
|
|
|
git clone https://$(WEBSITE_REPO) $(GOPATH)/src/$(WEBSITE_REPO)
|
|
|
|
endif
|
|
|
|
@$(MAKE) -C $(GOPATH)/src/$(WEBSITE_REPO) website-provider PROVIDER_PATH=$(shell pwd) PROVIDER_NAME=$(PKG_NAME)
|
|
|
|
|
|
|
|
website-test:
|
|
|
|
ifeq (,$(wildcard $(GOPATH)/src/$(WEBSITE_REPO)))
|
|
|
|
echo "$(WEBSITE_REPO) not found in your GOPATH (necessary for layouts and assets), get-ting..."
|
|
|
|
git clone https://$(WEBSITE_REPO) $(GOPATH)/src/$(WEBSITE_REPO)
|
|
|
|
endif
|
|
|
|
@$(MAKE) -C $(GOPATH)/src/$(WEBSITE_REPO) website-provider-test PROVIDER_PATH=$(shell pwd) PROVIDER_NAME=$(PKG_NAME)
|
|
|
|
|
2018-12-20 21:43:52 +00:00
|
|
|
.PHONY: build test testacc vet fmt fmtcheck errcheck test-compile website website-test
|
2017-06-05 20:54:03 +00:00
|
|
|
|