github.com/jaredpalmer/terraform@v1.1.0-alpha20210908.0.20210911170307-88705c943a03/Makefile (about) 1 WEBSITE_REPO=github.com/hashicorp/terraform-website 2 VERSION?="0.3.44" 3 4 # generate runs `go generate` to build the dynamically generated 5 # source files, except the protobuf stubs which are built instead with 6 # "make protobuf". 7 generate: 8 go generate ./... 9 10 # We separate the protobuf generation because most development tasks on 11 # Terraform do not involve changing protobuf files and protoc is not a 12 # go-gettable dependency and so getting it installed can be inconvenient. 13 # 14 # If you are working on changes to protobuf interfaces, run this Makefile 15 # target to be sure to regenerate all of the protobuf stubs using the expected 16 # versions of protoc and the protoc Go plugins. 17 protobuf: 18 go run ./tools/protobuf-compile . 19 20 fmtcheck: 21 @sh -c "'$(CURDIR)/scripts/gofmtcheck.sh'" 22 23 staticcheck: 24 @sh -c "'$(CURDIR)/scripts/staticcheck.sh'" 25 26 website: 27 ifeq (,$(wildcard $(GOPATH)/src/$(WEBSITE_REPO))) 28 echo "$(WEBSITE_REPO) not found in your GOPATH (necessary for layouts and assets), get-ting..." 29 git clone https://$(WEBSITE_REPO) $(GOPATH)/src/$(WEBSITE_REPO) 30 endif 31 $(eval WEBSITE_PATH := $(GOPATH)/src/$(WEBSITE_REPO)) 32 @echo "==> Starting core website in Docker..." 33 @docker run \ 34 --interactive \ 35 --rm \ 36 --tty \ 37 --publish "4567:4567" \ 38 --publish "35729:35729" \ 39 --volume "$(shell pwd)/website:/website" \ 40 --volume "$(shell pwd):/ext/terraform" \ 41 --volume "$(WEBSITE_PATH)/content:/terraform-website" \ 42 --volume "$(WEBSITE_PATH)/content/source/assets:/website/docs/assets" \ 43 --volume "$(WEBSITE_PATH)/content/source/layouts:/website/docs/layouts" \ 44 --workdir /terraform-website \ 45 hashicorp/middleman-hashicorp:${VERSION} 46 47 # disallow any parallelism (-j) for Make. This is necessary since some 48 # commands during the build process create temporary files that collide 49 # under parallel conditions. 50 .NOTPARALLEL: 51 52 .PHONY: fmtcheck generate protobuf website website-test staticcheck