From 775e235635c12d07fc13ba17eb0681c3c22db80f Mon Sep 17 00:00:00 2001 From: jojohappy Date: Wed, 24 Apr 2019 10:43:44 +0800 Subject: [PATCH] Fixed bug: - fetching go-bindata failed. - change the repo of go-bindata to github.com/go-bindata/go-bindata, because old repo has been archived. - pin the go-bindata as v3.3.1. Signed-off-by: jojohappy --- Makefile | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index f3d1679830b..4556f4ca618 100644 --- a/Makefile +++ b/Makefile @@ -27,6 +27,9 @@ PROTOC_VERSION ?= 3.4.0 # v0.54.0 HUGO_VERSION ?= b1a82c61aba067952fdae2f73b826fe7d0f3fc2f HUGO ?= $(GOBIN)/hugo-$(HUGO_VERSION) +# v3.1.1 +GOBINDATA_VERSION ?= a9c83481b38ebb1c4eb8f0168fd4b10ca1d3c523 +GOBINDATA ?= $(GOBIN)/go-bindata-$(GOBINDATA_VERSION) GIT ?= $(shell which git) BZR ?= $(shell which bzr) @@ -60,7 +63,7 @@ define fetch_go_bin_version fi @CDPATH='' cd -- '$(TMP_GOPATH)/src/$(1)' && git checkout -f -q '$(2)' @echo ">> installing $(1)@$(2)" - @GOBIN='$(TMP_GOPATH)/bin' GOPATH='$(TMP_GOPATH)' GO111MODULE='off' go install '$(1)' + @GOBIN='$(TMP_GOPATH)/bin' GOPATH='$(TMP_GOPATH)' GO111MODULE='off' go install '$(1)/...' @mv -- '$(TMP_GOPATH)/bin/$(shell basename $(1))' '$(GOBIN)/$(shell basename $(1))-$(2)' @echo ">> produced $(GOBIN)/$(shell basename $(1))-$(2)" @@ -90,12 +93,11 @@ all: format build # assets repacks all statis assets into go file for easier deploy. .PHONY: assets -assets: +assets: $(GOBINDATA) @echo ">> deleting asset file" @rm pkg/ui/bindata.go || true @echo ">> writing assets" - @go get -u github.com/jteeuwen/go-bindata/... - @go-bindata $(bindata_flags) -pkg ui -o pkg/ui/bindata.go -ignore '(.*\.map|bootstrap\.js|bootstrap-theme\.css|bootstrap\.css)' pkg/ui/templates/... pkg/ui/static/... + @$(GOBINDATA) $(bindata_flags) -pkg ui -o pkg/ui/bindata.go -ignore '(.*\.map|bootstrap\.js|bootstrap-theme\.css|bootstrap\.css)' pkg/ui/templates/... pkg/ui/static/... @go fmt ./pkg/ui @@ -278,6 +280,9 @@ $(PROMU): $(HUGO): $(call fetch_go_bin_version,github.com/gohugoio/hugo,$(HUGO_VERSION)) +$(GOBINDATA): + $(call fetch_go_bin_version,github.com/go-bindata/go-bindata,$(GOBINDATA_VERSION)) + $(PROTOC): @mkdir -p $(TMP_GOPATH) @echo ">> fetching protoc@${PROTOC_VERSION}"