diff --git a/cmd/kubectl/Makefile b/cmd/kubectl/Makefile index a12443dba..b2f9dff29 100644 --- a/cmd/kubectl/Makefile +++ b/cmd/kubectl/Makefile @@ -5,7 +5,7 @@ GOBIN := $(shell go env GOPATH)/bin -all: generate license fix vet fmt test lint tidy +all: generate license fix vet fmt test tidy fix: go fix ./... @@ -33,4 +33,3 @@ test: vet: go vet ./... - diff --git a/functions/examples/application-cr/Makefile b/functions/examples/application-cr/Makefile index 540708df4..9b057cec2 100644 --- a/functions/examples/application-cr/Makefile +++ b/functions/examples/application-cr/Makefile @@ -21,8 +21,8 @@ generate: (cd image && GOBIN=$(GOBIN) go generate ./...) license: - (which $(GOPATH)/bin/addlicense || go get github.com/google/addlicense) - $(GOPATH)/bin/addlicense -y 2019 -c "The Kubernetes Authors." -f LICENSE_TEMPLATE . + (which $(GOBIN)/addlicense || go get github.com/google/addlicense) + $(GOBIN)/addlicense -y 2019 -c "The Kubernetes Authors." -f LICENSE_TEMPLATE . tidy: (cd image && go mod tidy) diff --git a/functions/examples/injection-tshirt-sizes/Makefile b/functions/examples/injection-tshirt-sizes/Makefile index 8e3dcc300..1f79b472d 100644 --- a/functions/examples/injection-tshirt-sizes/Makefile +++ b/functions/examples/injection-tshirt-sizes/Makefile @@ -21,8 +21,8 @@ generate: (cd image && GOBIN=$(GOBIN) go generate ./...) license: - (which $(GOPATH)/bin/addlicense || go get github.com/google/addlicense) - $(GOPATH)/bin/addlicense -y 2019 -c "The Kubernetes Authors." -f LICENSE_TEMPLATE . + (which $(GOBIN)/addlicense || go get github.com/google/addlicense) + $(GOBIN)/addlicense -y 2019 -c "The Kubernetes Authors." -f LICENSE_TEMPLATE . tidy: (cd image && go mod tidy) diff --git a/functions/examples/template-go-nginx/Makefile b/functions/examples/template-go-nginx/Makefile index 3149fd10c..c3e0c2cb4 100644 --- a/functions/examples/template-go-nginx/Makefile +++ b/functions/examples/template-go-nginx/Makefile @@ -21,8 +21,8 @@ generate: (cd image && GOBIN=$(GOBIN) go generate ./...) license: - (which $(GOPATH)/bin/addlicense || go get github.com/google/addlicense) - $(GOPATH)/bin/addlicense -y 2019 -c "The Kubernetes Authors." -f LICENSE_TEMPLATE . + (which $(GOBIN)/addlicense || go get github.com/google/addlicense) + $(GOBIN)/addlicense -y 2019 -c "The Kubernetes Authors." -f LICENSE_TEMPLATE . tidy: (cd image && go mod tidy) diff --git a/functions/examples/template-heredoc-cockroachdb/Makefile b/functions/examples/template-heredoc-cockroachdb/Makefile index 0badb79a7..d218aca00 100644 --- a/functions/examples/template-heredoc-cockroachdb/Makefile +++ b/functions/examples/template-heredoc-cockroachdb/Makefile @@ -3,9 +3,11 @@ .PHONY: license image +GOBIN := $(shell go env GOPATH)/bin + license: - (which $(GOPATH)/bin/addlicense || go get github.com/google/addlicense) - $(GOPATH)/bin/addlicense -y 2019 -c "The Kubernetes Authors." -f LICENSE_TEMPLATE . + (which $(GOBIN)/addlicense || go get github.com/google/addlicense) + $(GOBIN)/addlicense -y 2019 -c "The Kubernetes Authors." -f LICENSE_TEMPLATE . all: license diff --git a/functions/examples/validator-kubeval/Makefile b/functions/examples/validator-kubeval/Makefile index b8030c006..08a214c41 100644 --- a/functions/examples/validator-kubeval/Makefile +++ b/functions/examples/validator-kubeval/Makefile @@ -21,8 +21,8 @@ generate: (cd image && GOBIN=$(GOBIN) go generate ./...) license: - (which $(GOPATH)/bin/addlicense || go get github.com/google/addlicense) - $(GOPATH)/bin/addlicense -y 2019 -c "The Kubernetes Authors." -f LICENSE_TEMPLATE . + (which $(GOBIN)/addlicense || go get github.com/google/addlicense) + $(GOBIN)/addlicense -y 2019 -c "The Kubernetes Authors." -f LICENSE_TEMPLATE . tidy: (cd image && go mod tidy) diff --git a/functions/examples/validator-resource-requests/Makefile b/functions/examples/validator-resource-requests/Makefile index 95fb12b89..f3d362626 100644 --- a/functions/examples/validator-resource-requests/Makefile +++ b/functions/examples/validator-resource-requests/Makefile @@ -21,8 +21,8 @@ generate: (cd image && GOBIN=$(GOBIN) go generate ./...) license: - (which $(GOPATH)/bin/addlicense || go get github.com/google/addlicense) - $(GOPATH)/bin/addlicense -y 2019 -c "The Kubernetes Authors." -f LICENSE_TEMPLATE . + (which $(GOBIN)/addlicense || go get github.com/google/addlicense) + $(GOBIN)/addlicense -y 2019 -c "The Kubernetes Authors." -f LICENSE_TEMPLATE . tidy: (cd image && go mod tidy) diff --git a/travis/kyaml-pre-commit.sh b/travis/kyaml-pre-commit.sh index d357f2c4b..962f5189b 100755 --- a/travis/kyaml-pre-commit.sh +++ b/travis/kyaml-pre-commit.sh @@ -5,8 +5,21 @@ set -e # run all tests for kyaml and related commands -targets="kyaml cmd/config cmd/kubectl functions/examples/injection-tshirt-sizes functions/examples/template-go-nginx functions/examples/template-heredoc-cockroachdb functions/examples/validator-kubeval functions/examples/validator-resource-requests functions/examples/application-cr" + +targets=" +kyaml +cmd/config +cmd/kubectl +functions/examples/injection-tshirt-sizes +functions/examples/template-go-nginx +functions/examples/template-heredoc-cockroachdb +functions/examples/validator-kubeval +functions/examples/validator-resource-requests +functions/examples/application-cr +" + for target in $targets; do + echo "----- Making $target -----" pushd . cd $target make all