build: propagation of GOPROXY env var

Signed-off-by: Damien <maitredede@gmail.com>
This commit is contained in:
Damien 2023-02-14 09:05:56 +11:00 committed by mergify[bot]
parent 50668e7216
commit 102616b158
1 changed files with 7 additions and 0 deletions

View File

@ -54,6 +54,7 @@ endif
GO_CMD:=go GO_CMD:=go
GOFMT_CMD:=gofmt GOFMT_CMD:=gofmt
GOARCH:=$(shell $(GO_CMD) env GOARCH) GOARCH:=$(shell $(GO_CMD) env GOARCH)
GOPROXY:=$(shell $(GO_CMD) env GOPROXY)
# the full name of the marker file including the ceph version # the full name of the marker file including the ceph version
BUILDFILE=.build.$(CEPH_VERSION) BUILDFILE=.build.$(CEPH_VERSION)
@ -78,6 +79,9 @@ else
endif endif
CONTAINER_OPTS += -e BUILD_TAGS=$(BUILD_TAGS) CONTAINER_OPTS += -e BUILD_TAGS=$(BUILD_TAGS)
ifdef GOPROXY
CONTAINER_OPTS += --env GOPROXY=$(GOPROXY)
endif
ifneq ($(USE_CACHE),) ifneq ($(USE_CACHE),)
GOCACHE_VOLUME := -v test_ceph_go_cache:/go GOCACHE_VOLUME := -v test_ceph_go_cache:/go
@ -111,6 +115,9 @@ ifdef GO_CEPH_VERSION
else else
CONTAINER_BUILD_ARGS += --build-arg GO_CEPH_VERSION=$(CEPH_VERSION) CONTAINER_BUILD_ARGS += --build-arg GO_CEPH_VERSION=$(CEPH_VERSION)
endif endif
ifdef GOPROXY
CONTAINER_BUILD_ARGS += --build-arg GOPROXY=$(GOPROXY)
endif
build: build:
$(GO_CMD) build -v -tags $(BUILD_TAGS) $(shell $(GO_CMD) list ./... | grep -v /contrib) $(GO_CMD) build -v -tags $(BUILD_TAGS) $(shell $(GO_CMD) list ./... | grep -v /contrib)