From ec0e42709a6ddc8f94892c46d48ed244e08cbdea Mon Sep 17 00:00:00 2001 From: Li Zhijian Date: Wed, 10 Feb 2021 14:07:14 +0800 Subject: [PATCH] functions/examples: set proper GOBIN Signed-off-by: Li Zhijian --- functions/examples/application-cr/Makefile | 5 ++++- functions/examples/injection-tshirt-sizes/Makefile | 5 ++++- functions/examples/template-go-nginx/Makefile | 5 ++++- functions/examples/template-heredoc-cockroachdb/Makefile | 5 ++++- functions/examples/validator-kubeval/Makefile | 5 ++++- functions/examples/validator-resource-requests/Makefile | 5 ++++- 6 files changed, 24 insertions(+), 6 deletions(-) diff --git a/functions/examples/application-cr/Makefile b/functions/examples/application-cr/Makefile index 9b057cec2..670a475ab 100644 --- a/functions/examples/application-cr/Makefile +++ b/functions/examples/application-cr/Makefile @@ -3,7 +3,10 @@ .PHONY: generate license fix vet fmt test build tidy image -GOBIN := $(shell go env GOPATH)/bin +GOBIN = $(shell go env GOBIN) +ifeq ($(GOBIN),) +GOBIN = $(shell go env GOPATH)/bin +endif build: (cd image && go build -v -o $(GOBIN)/config-function .) diff --git a/functions/examples/injection-tshirt-sizes/Makefile b/functions/examples/injection-tshirt-sizes/Makefile index 9cf21bc2a..e52c7d18d 100644 --- a/functions/examples/injection-tshirt-sizes/Makefile +++ b/functions/examples/injection-tshirt-sizes/Makefile @@ -3,7 +3,10 @@ .PHONY: generate license fix vet fmt test build tidy image -GOBIN := $(shell go env GOPATH)/bin +GOBIN = $(shell go env GOBIN) +ifeq ($(GOBIN),) +GOBIN = $(shell go env GOPATH)/bin +endif build: (cd image && go build -v -o $(GOBIN)/config-function .) diff --git a/functions/examples/template-go-nginx/Makefile b/functions/examples/template-go-nginx/Makefile index ab76261e9..f17ce5ecb 100644 --- a/functions/examples/template-go-nginx/Makefile +++ b/functions/examples/template-go-nginx/Makefile @@ -3,7 +3,10 @@ .PHONY: generate license fix vet fmt test build tidy image -GOBIN := $(shell go env GOPATH)/bin +GOBIN = $(shell go env GOBIN) +ifeq ($(GOBIN),) +GOBIN = $(shell go env GOPATH)/bin +endif build: (cd image && go build -v -o $(GOBIN)/config-function .) diff --git a/functions/examples/template-heredoc-cockroachdb/Makefile b/functions/examples/template-heredoc-cockroachdb/Makefile index d218aca00..469ab5cc4 100644 --- a/functions/examples/template-heredoc-cockroachdb/Makefile +++ b/functions/examples/template-heredoc-cockroachdb/Makefile @@ -3,7 +3,10 @@ .PHONY: license image -GOBIN := $(shell go env GOPATH)/bin +GOBIN = $(shell go env GOBIN) +ifeq ($(GOBIN),) +GOBIN = $(shell go env GOPATH)/bin +endif license: (which $(GOBIN)/addlicense || go get github.com/google/addlicense) diff --git a/functions/examples/validator-kubeval/Makefile b/functions/examples/validator-kubeval/Makefile index 08a214c41..47aff3eb2 100644 --- a/functions/examples/validator-kubeval/Makefile +++ b/functions/examples/validator-kubeval/Makefile @@ -3,7 +3,10 @@ .PHONY: generate license fix vet fmt test build tidy image -GOBIN := $(shell go env GOPATH)/bin +GOBIN = $(shell go env GOBIN) +ifeq ($(GOBIN),) +GOBIN = $(shell go env GOPATH)/bin +endif build: (cd image && go build -v -o $(GOBIN)/config-function .) diff --git a/functions/examples/validator-resource-requests/Makefile b/functions/examples/validator-resource-requests/Makefile index f3d362626..8bfa4d177 100644 --- a/functions/examples/validator-resource-requests/Makefile +++ b/functions/examples/validator-resource-requests/Makefile @@ -3,7 +3,10 @@ .PHONY: generate license fix vet fmt test build tidy image -GOBIN := $(shell go env GOPATH)/bin +GOBIN = $(shell go env GOBIN) +ifeq ($(GOBIN),) +GOBIN = $(shell go env GOPATH)/bin +endif build: (cd image && go build -v -o $(GOBIN)/config-function .)