|
|
|
|
@ -4,12 +4,12 @@ VETARGS?=-asmdecl -atomic -bool -buildtags -copylocks -methods -nilfunc -printf
|
|
|
|
|
default: test
|
|
|
|
|
|
|
|
|
|
# bin generates the releaseable binaries for Terraform
|
|
|
|
|
bin: generate
|
|
|
|
|
bin: fmtcheck generate
|
|
|
|
|
@sh -c "'$(CURDIR)/scripts/build.sh'"
|
|
|
|
|
|
|
|
|
|
# dev creates binaries for testing Terraform locally. These are put
|
|
|
|
|
# into ./bin/ as well as $GOPATH/bin
|
|
|
|
|
dev: generate
|
|
|
|
|
dev: fmtcheck generate
|
|
|
|
|
@TF_DEV=1 sh -c "'$(CURDIR)/scripts/build.sh'"
|
|
|
|
|
|
|
|
|
|
quickdev: generate
|
|
|
|
|
@ -18,22 +18,22 @@ quickdev: generate
|
|
|
|
|
# Shorthand for quickly building the core of Terraform. Note that some
|
|
|
|
|
# changes will require a rebuild of everything, in which case the dev
|
|
|
|
|
# target should be used.
|
|
|
|
|
core-dev: generate
|
|
|
|
|
core-dev: fmtcheck generate
|
|
|
|
|
go install github.com/hashicorp/terraform
|
|
|
|
|
|
|
|
|
|
# Shorthand for building and installing just one plugin for local testing.
|
|
|
|
|
# Run as (for example): make plugin-dev PLUGIN=provider-aws
|
|
|
|
|
plugin-dev: generate
|
|
|
|
|
plugin-dev: fmtcheck generate
|
|
|
|
|
go install github.com/hashicorp/terraform/builtin/bins/$(PLUGIN)
|
|
|
|
|
mv $(GOPATH)/bin/$(PLUGIN) $(GOPATH)/bin/terraform-$(PLUGIN)
|
|
|
|
|
|
|
|
|
|
# test runs the unit tests and vets the code
|
|
|
|
|
test: generate
|
|
|
|
|
test: fmtcheck generate
|
|
|
|
|
TF_ACC= go test $(TEST) $(TESTARGS) -timeout=30s -parallel=4
|
|
|
|
|
@$(MAKE) vet
|
|
|
|
|
|
|
|
|
|
# testacc runs acceptance tests
|
|
|
|
|
testacc: generate
|
|
|
|
|
testacc: fmtcheck generate
|
|
|
|
|
@if [ "$(TEST)" = "./..." ]; then \
|
|
|
|
|
echo "ERROR: Set TEST to a specific package. For example,"; \
|
|
|
|
|
echo " make testacc TEST=./builtin/providers/aws"; \
|
|
|
|
|
@ -42,7 +42,7 @@ testacc: generate
|
|
|
|
|
TF_ACC=1 go test $(TEST) -v $(TESTARGS) -timeout 90m
|
|
|
|
|
|
|
|
|
|
# testrace runs the race checker
|
|
|
|
|
testrace: generate
|
|
|
|
|
testrace: fmtcheck generate
|
|
|
|
|
TF_ACC= go test -race $(TEST) $(TESTARGS)
|
|
|
|
|
|
|
|
|
|
# updatedeps installs all the dependencies that Terraform needs to run
|
|
|
|
|
@ -84,4 +84,10 @@ vet:
|
|
|
|
|
generate:
|
|
|
|
|
go generate ./...
|
|
|
|
|
|
|
|
|
|
.PHONY: bin default generate test updatedeps vet
|
|
|
|
|
fmt:
|
|
|
|
|
gofmt -w .
|
|
|
|
|
|
|
|
|
|
fmtcheck:
|
|
|
|
|
@sh -c "'$(CURDIR)/scripts/gofmtcheck.sh'"
|
|
|
|
|
|
|
|
|
|
.PHONY: bin default generate test updatedeps vet fmt fmtcheck
|
|
|
|
|
|