From ca4e5e379175324d11c7769465b6a637cad446a5 Mon Sep 17 00:00:00 2001 From: lokielse Date: Thu, 13 Nov 2025 22:00:32 +0800 Subject: [PATCH] ci: add support for custom GOPROXY and GOSUMDB in Docker environment --- .gitignore | 2 ++ build/makefile/golang.mk | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/.gitignore b/.gitignore index ceb66cdfd..d7037c013 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,8 @@ coverage/ *.test launch.json coverage.out +vendor/ +/generate-dep.go cmd/fairshare-simulator/fairshare-simulator cmd/snapshot-tool/snapshot-tool diff --git a/build/makefile/golang.mk b/build/makefile/golang.mk index 3c4138385..d81806f8e 100644 --- a/build/makefile/golang.mk +++ b/build/makefile/golang.mk @@ -13,6 +13,12 @@ GOCACHE_HOST_DIR=${HOME}/.cache/go-build-docker-gocache GOPATH_HOST_DIR=${HOME}/.cache/go-build-docker-gopath DOCKER_GO_CACHING_VOLUME_AND_ENV := -v ${GOPATH_HOST_DIR}:/go:z -v ${GOCACHE_HOST_DIR}:${GOCACHE_DOCKER_DIR}:z -e GOPATH=/go -e GOCACHE=${GOCACHE_DOCKER_DIR} -e GOLANGCI_LINT_CACHE=${GOCACHE_DOCKER_DIR} +ifneq ($(GOPROXY),) +DOCKER_GO_CACHING_VOLUME_AND_ENV += -e GOPROXY=$(GOPROXY) +endif +ifneq ($(GOSUMDB),) +DOCKER_GO_CACHING_VOLUME_AND_ENV += -e GOSUMDB=$(GOSUMDB) +endif ## Version GO_VERSION=1.24.4