github.com/iaas-resource-provision/iaas-rpc@v1.0.7-0.20211021023331-ed21f798c408/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 you may either use
    15  # this target or run the individual scripts below directly.
    16  protobuf:
    17  	bash scripts/protobuf-check.sh
    18  	bash internal/tfplugin5/generate.sh
    19  	bash internal/plans/internal/planproto/generate.sh
    20  
    21  fmtcheck:
    22  	@sh -c "'$(CURDIR)/scripts/gofmtcheck.sh'"
    23  
    24  website:
    25  ifeq (,$(wildcard $(GOPATH)/src/$(WEBSITE_REPO)))
    26  	echo "$(WEBSITE_REPO) not found in your GOPATH (necessary for layouts and assets), get-ting..."
    27  	git clone https://$(WEBSITE_REPO) $(GOPATH)/src/$(WEBSITE_REPO)
    28  endif
    29  	$(eval WEBSITE_PATH := $(GOPATH)/src/$(WEBSITE_REPO))
    30  	@echo "==> Starting core website in Docker..."
    31  	@docker run \
    32  		--interactive \
    33  		--rm \
    34  		--tty \
    35  		--publish "4567:4567" \
    36  		--publish "35729:35729" \
    37  		--volume "$(shell pwd)/website:/website" \
    38  		--volume "$(shell pwd):/ext/terraform" \
    39  		--volume "$(WEBSITE_PATH)/content:/terraform-website" \
    40  		--volume "$(WEBSITE_PATH)/content/source/assets:/website/docs/assets" \
    41  		--volume "$(WEBSITE_PATH)/content/source/layouts:/website/docs/layouts" \
    42  		--workdir /terraform-website \
    43  		hashicorp/middleman-hashicorp:${VERSION}
    44  
    45  # disallow any parallelism (-j) for Make. This is necessary since some
    46  # commands during the build process create temporary files that collide
    47  # under parallel conditions.
    48  .NOTPARALLEL:
    49  
    50  .PHONY: fmtcheck generate protobuf website website-test