fix: adapt go proxy settings
This commit is contained in:
parent
9207833a71
commit
6e6a1cbbb6
@ -12,7 +12,9 @@ ARG VERSION
|
||||
# ==================================
|
||||
FROM ${BUILD_IMAGE} AS build
|
||||
COPY . /workspace
|
||||
RUN make ${EXECUTABLE_TARGET} VERSION=${VERSION} GOPROXY=${GOPROXY} GOPRIVATE=${GOPRIVATE}
|
||||
ENV GOPROXY=${GOPROXY}
|
||||
ENV GOPRIVATE=${GOPRIVATE}
|
||||
RUN make ${EXECUTABLE_TARGET} VERSION=${VERSION}
|
||||
|
||||
# TARGET
|
||||
# ==================================
|
||||
|
32
Makefile
32
Makefile
@ -3,14 +3,6 @@
|
||||
# value is taken.
|
||||
VERSION?=$(shell git describe --abbrev=0)+$(shell date +'%Y%m%d%H%I%S')
|
||||
|
||||
# GOPROXY settings
|
||||
# If no GOPROXY environment variable available, the pre-defined GOPROXY from go
|
||||
# env to download and validate go modules is used. Exclude downloading and
|
||||
# validation of all private modules which are pre-defined in GOPRIVATE. If no
|
||||
# GOPRIVATE variable defined, the variable of go env is used.
|
||||
GOPROXY?=$(shell go env GOPROXY)
|
||||
GOPRIVATE?=$(shell go env GOPRIVATE)
|
||||
|
||||
# CONTAINER_RUNTIME
|
||||
# The CONTAINER_RUNTIME variable will be used to specified the path to a
|
||||
# container runtime. This is needed to start and run a container images.
|
||||
@ -34,8 +26,8 @@ bin/linux/amd64/${EXECUTABLE}:
|
||||
CGO_ENABLED=1 \
|
||||
GOOS=linux \
|
||||
GOARCH=amd64 \
|
||||
GOPROXY=${GOPROXY} \
|
||||
GOPRIVATE=${GOPRIVATE} \
|
||||
GOPROXY=$(shell go env GOPROXY) \
|
||||
GOPRIVATE=$(shell go env GOPRIVATE) \
|
||||
go build -ldflags "-X main.version=${VERSION:v%=%}" -o ${@}
|
||||
|
||||
bin/linux/arm/5/${EXECUTABLE}:
|
||||
@ -43,8 +35,8 @@ bin/linux/arm/5/${EXECUTABLE}:
|
||||
GOOS=linux \
|
||||
GOARCH=arm \
|
||||
GOARM=5 \
|
||||
GOPROXY=${GOPROXY} \
|
||||
GOPRIVATE=${GOPRIVATE} \
|
||||
GOPROXY=$(shell go env GOPROXY) \
|
||||
GOPRIVATE=$(shell go env GOPRIVATE) \
|
||||
go build -ldflags "-X main.version=${VERSION:v%=%}" -o ${@}
|
||||
|
||||
bin/linux/arm/7/${EXECUTABLE}:
|
||||
@ -53,14 +45,14 @@ bin/linux/arm/7/${EXECUTABLE}:
|
||||
GOOS=linux \
|
||||
GOARCH=arm \
|
||||
GOARM=7 \
|
||||
GOPROXY=${GOPROXY} \
|
||||
GOPRIVATE=${GOPRIVATE} \
|
||||
GOPROXY=$(shell go env GOPROXY) \
|
||||
GOPRIVATE=$(shell go env GOPRIVATE) \
|
||||
go build -ldflags "-X main.version=${VERSION:v%=%}" -o ${@}
|
||||
|
||||
bin/tmp/${EXECUTABLE}:
|
||||
CGO_ENABLED=1 \
|
||||
GOPROXY=${GOPROXY} \
|
||||
GOPRIVATE=${GOPRIVATE} \
|
||||
GOPROXY=$(shell go env GOPROXY) \
|
||||
GOPRIVATE=$(shell go env GOPRIVATE) \
|
||||
go build -ldflags "-X main.version=${VERSION:v%=%}" -o ${@}
|
||||
|
||||
# CLEAN
|
||||
@ -87,8 +79,8 @@ container-image/build/amd64:
|
||||
--build-arg BUILD_IMAGE=docker.io/volkerraschek/build-image:latest \
|
||||
--build-arg EXECUTABLE=${EXECUTABLE} \
|
||||
--build-arg EXECUTABLE_TARGET=bin/linux/amd64/${EXECUTABLE} \
|
||||
--build-arg GOPROXY=${GOPROXY} \
|
||||
--build-arg GOPRIVATE=${GOPRIVATE} \
|
||||
--build-arg GOPROXY=$(shell go env GOPROXY) \
|
||||
--build-arg GOPRIVATE=$(shell go env GOPRIVATE) \
|
||||
--build-arg VERSION=${VERSION} \
|
||||
--file Dockerfile \
|
||||
--no-cache \
|
||||
@ -136,13 +128,13 @@ container-run/test/unit:
|
||||
PHONY+=container-run
|
||||
container-run:
|
||||
${CONTAINER_RUNTIME} run \
|
||||
--env GOPROXY=$(shell go env GOPROXY) \
|
||||
--env GOPRIVATE=$(shell go env GOPRIVATE) \
|
||||
--rm \
|
||||
--volume ${PWD}:/workspace \
|
||||
--volume /var/run/docker.sock:/var/run/docker.sock \
|
||||
docker.io/volkerraschek/build-image:latest \
|
||||
make ${COMMAND} \
|
||||
GOPROXY=${GOPROXY} \
|
||||
GOPRIVATE=${GOPRIVATE} \
|
||||
VERSION=${VERSION:v%=%}
|
||||
|
||||
# REMOTE
|
||||
|
Loading…
Reference in New Issue
Block a user