diff options
-rw-r--r-- | .travis.yml | 5 | ||||
-rw-r--r-- | GNUmakefile | 20 | ||||
-rw-r--r-- | README.md | 10 |
3 files changed, 27 insertions, 8 deletions
diff --git a/.travis.yml b/.travis.yml index 1ba1993..0eabb81 100644 --- a/.travis.yml +++ b/.travis.yml | |||
@@ -1,5 +1,7 @@ | |||
1 | dist: trusty | 1 | dist: trusty |
2 | sudo: false | 2 | sudo: required |
3 | services: | ||
4 | - docker | ||
3 | language: go | 5 | language: go |
4 | go: | 6 | go: |
5 | - 1.8.1 | 7 | - 1.8.1 |
@@ -16,6 +18,7 @@ script: | |||
16 | - make test | 18 | - make test |
17 | - make vendor-status | 19 | - make vendor-status |
18 | - make vet | 20 | - make vet |
21 | - make website-test | ||
19 | 22 | ||
20 | branches: | 23 | branches: |
21 | only: | 24 | only: |
diff --git a/GNUmakefile b/GNUmakefile index c9eacb4..98a0985 100644 --- a/GNUmakefile +++ b/GNUmakefile | |||
@@ -1,5 +1,7 @@ | |||
1 | TEST?=$$(go list ./... |grep -v 'vendor') | 1 | TEST?=$$(go list ./... |grep -v 'vendor') |
2 | GOFMT_FILES?=$$(find . -name '*.go' |grep -v vendor) | 2 | GOFMT_FILES?=$$(find . -name '*.go' |grep -v vendor) |
3 | WEBSITE_REPO=github.com/hashicorp/terraform-website | ||
4 | PKG_NAME=statuscake | ||
3 | 5 | ||
4 | default: build | 6 | default: build |
5 | 7 | ||
@@ -38,10 +40,24 @@ vendor-status: | |||
38 | test-compile: | 40 | test-compile: |
39 | @if [ "$(TEST)" = "./..." ]; then \ | 41 | @if [ "$(TEST)" = "./..." ]; then \ |
40 | echo "ERROR: Set TEST to a specific package. For example,"; \ | 42 | 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)"; \ |
42 | exit 1; \ | 44 | exit 1; \ |
43 | fi | 45 | fi |
44 | go test -c $(TEST) $(TESTARGS) | 46 | go test -c $(TEST) $(TESTARGS) |
45 | 47 | ||
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 | ||
47 | 63 | ||
@@ -16,17 +16,17 @@ Requirements | |||
16 | Building The Provider | 16 | Building The Provider |
17 | --------------------- | 17 | --------------------- |
18 | 18 | ||
19 | Clone repository to: `$GOPATH/src/github.com/hashicorp/terraform-provider-$PROVIDER_NAME` | 19 | Clone repository to: `$GOPATH/src/github.com/terraform-providers/terraform-provider-statuscake` |
20 | 20 | ||
21 | ```sh | 21 | ```sh |
22 | $ mkdir -p $GOPATH/src/github.com/hashicorp; cd $GOPATH/src/github.com/hashicorp | 22 | $ mkdir -p $GOPATH/src/github.com/terraform-providers; cd $GOPATH/src/github.com/terraform-providers |
23 | $ git clone git@github.com:hashicorp/terraform-provider-$PROVIDER_NAME | 23 | $ git clone git@github.com:terraform-providers/terraform-provider-statuscake |
24 | ``` | 24 | ``` |
25 | 25 | ||
26 | Enter the provider directory and build the provider | 26 | Enter the provider directory and build the provider |
27 | 27 | ||
28 | ```sh | 28 | ```sh |
29 | $ cd $GOPATH/src/github.com/hashicorp/terraform-provider-$PROVIDER_NAME | 29 | $ cd $GOPATH/src/github.com/terraform-providers/terraform-provider-statuscake |
30 | $ make build | 30 | $ make build |
31 | ``` | 31 | ``` |
32 | 32 | ||
@@ -44,7 +44,7 @@ To compile the provider, run `make build`. This will build the provider and put | |||
44 | ```sh | 44 | ```sh |
45 | $ make bin | 45 | $ make bin |
46 | ... | 46 | ... |
47 | $ $GOPATH/bin/terraform-provider-$PROVIDER_NAME | 47 | $ $GOPATH/bin/terraform-provider-statuscake |
48 | ... | 48 | ... |
49 | ``` | 49 | ``` |
50 | 50 | ||