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

View File

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