diff --git a/Dockerfile b/Dockerfile index 12be8e7..5ca2321 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # Stage 1: deps -FROM golang:1.24.2-alpine AS deps +FROM golang:1.24.3-alpine AS deps HEALTHCHECK NONE # package version does not matter diff --git a/Makefile b/Makefile index b24b79d..36f63cb 100755 --- a/Makefile +++ b/Makefile @@ -79,6 +79,22 @@ docker-build-test: get: for dir in ${PWD} ${PWD}/agent ${PWD}/internal/dnsproviders; do cd $$dir && go get -u ./... && go mod tidy; done + +go_ver := $(shell go version | cut -d' ' -f3 | cut -d'o' -f2) +files := $(shell find . -name go.mod -type f -or -name Dockerfile -type f) +gomod_paths := $(shell find . -name go.mod -type f | xargs dirname) + +update-go: + for file in ${files}; do \ + echo "updating $$file"; \ + sed -i 's|go \([0-9]\+\.[0-9]\+\.[0-9]\+\)|go ${go_ver}|g' $$file; \ + sed -i 's|FROM golang:.*-alpine|FROM golang:${go_ver}-alpine|g' $$file; \ + done + for path in ${gomod_paths}; do \ + echo "go mod tidy $$path"; \ + cd ${PWD}/$$path && go mod tidy; \ + done + build: mkdir -p $(shell dirname ${BIN_PATH}) cd ${PWD} && go build ${BUILD_FLAGS} -o ${BIN_PATH} ${CMD_PATH} diff --git a/agent/go.mod b/agent/go.mod index f006867..d2a74c7 100644 --- a/agent/go.mod +++ b/agent/go.mod @@ -1,6 +1,6 @@ module github.com/yusing/go-proxy/agent -go 1.24.2 +go 1.24.3 replace github.com/yusing/go-proxy => .. diff --git a/go.mod b/go.mod index adcb55b..df0affc 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/yusing/go-proxy -go 1.24.2 +go 1.24.3 replace github.com/yusing/go-proxy/agent => ./agent diff --git a/internal/dnsproviders/go.mod b/internal/dnsproviders/go.mod index 2ff11d2..58c2169 100644 --- a/internal/dnsproviders/go.mod +++ b/internal/dnsproviders/go.mod @@ -1,6 +1,6 @@ module github.com/yusing/go-proxy/internal/dnsproviders -go 1.24.2 +go 1.24.3 replace github.com/yusing/go-proxy => ../..