Skip to content

Commit b01028f

Browse files
authored
Merge pull request #1398 from terraform-providers/f-make-website
make: Add website + website-test targets
2 parents ac64624 + 2192210 commit b01028f

File tree

2 files changed

+22
-3
lines changed

2 files changed

+22
-3
lines changed

.travis.yml

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
dist: trusty
2-
sudo: false
2+
sudo: required
3+
services:
4+
- docker
35
language: go
46
go:
57
- 1.9.1
@@ -16,6 +18,7 @@ script:
1618
- make test
1719
- make vendor-status
1820
- make vet
21+
- make website-test
1922

2023
branches:
2124
only:

GNUmakefile

+18-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
TEST?=$$(go list ./... |grep -v 'vendor')
22
GOFMT_FILES?=$$(find . -name '*.go' |grep -v vendor)
3+
WEBSITE_REPO=github.com/hashicorp/terraform-website
4+
PKG_NAME=google
35

46
default: build
57

@@ -38,10 +40,24 @@ vendor-status:
3840
test-compile:
3941
@if [ "$(TEST)" = "./..." ]; then \
4042
echo "ERROR: Set TEST to a specific package. For example,"; \
41-
echo " make test-compile TEST=./aws"; \
43+
echo " make test-compile TEST=./$(PKG_NAME)"; \
4244
exit 1; \
4345
fi
4446
go test -c $(TEST) $(TESTARGS)
4547

46-
.PHONY: build test testacc vet fmt fmtcheck errcheck vendor-status test-compile
48+
website:
49+
ifeq (,$(wildcard $(GOPATH)/src/$(WEBSITE_REPO)))
50+
echo "$(WEBSITE_REPO) not found in your GOPATH (necessary for layouts and assets), get-ting..."
51+
git clone https://$(WEBSITE_REPO) $(GOPATH)/src/$(WEBSITE_REPO)
52+
endif
53+
@$(MAKE) -C $(GOPATH)/src/$(WEBSITE_REPO) website-provider PROVIDER_PATH=$(shell pwd) PROVIDER_NAME=$(PKG_NAME)
54+
55+
website-test:
56+
ifeq (,$(wildcard $(GOPATH)/src/$(WEBSITE_REPO)))
57+
echo "$(WEBSITE_REPO) not found in your GOPATH (necessary for layouts and assets), get-ting..."
58+
git clone https://$(WEBSITE_REPO) $(GOPATH)/src/$(WEBSITE_REPO)
59+
endif
60+
@$(MAKE) -C $(GOPATH)/src/$(WEBSITE_REPO) website-provider-test PROVIDER_PATH=$(shell pwd) PROVIDER_NAME=$(PKG_NAME)
61+
62+
.PHONY: build test testacc vet fmt fmtcheck errcheck vendor-status test-compile website website-test
4763

0 commit comments

Comments
 (0)