From 81652d16ef3b14c99e824bb48239a1c538b00d81 Mon Sep 17 00:00:00 2001 From: Lili Cosic Date: Mon, 19 Apr 2021 17:46:36 +0200 Subject: [PATCH 1/2] Makefile: Fix build-docker-release-master Since the Dockerfile files are now per arch, this adjusts to detect ARCH and builds docker release from the Dockerfile. file. --- Makefile | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index f462dfb89..80a23d467 100644 --- a/Makefile +++ b/Makefile @@ -12,6 +12,7 @@ UNAME := $(shell uname) XARGS = xargs +ARCH ?= $(shell go env GOARCH) # -r is only necessary on GNU xargs. ifeq ($(UNAME), Linux) @@ -28,7 +29,7 @@ build: clean: rm -f ./codecov rm -rf ./covdir - rm -f ./bin/Dockerfile-release + rm -f ./bin/Dockerfile-release* rm -rf ./bin/etcd* rm -rf ./default.etcd rm -rf ./tests/e2e/default.etcd @@ -198,13 +199,13 @@ docker-test-coverage: build-docker-release-master: $(info ETCD_VERSION: $(ETCD_VERSION)) - cp ./Dockerfile-release ./bin/Dockerfile-release + cp ./Dockerfile-release.$(ARCH) ./bin/Dockerfile-release.$(ARCH) docker build \ --network=host \ --tag gcr.io/etcd-development/etcd:$(ETCD_VERSION) \ - --file ./bin/Dockerfile-release \ + --file ./bin/Dockerfile-release.$(ARCH) \ ./bin - rm -f ./bin/Dockerfile-release + rm -f ./bin/Dockerfile-release.$(ARCH) docker run \ --rm \ From 51c28fc4752df084a277795ebcb0132e29fee60b Mon Sep 17 00:00:00 2001 From: Lili Cosic Date: Mon, 19 Apr 2021 17:48:23 +0200 Subject: [PATCH 2/2] build.sh: Adjust building etcdctl to be same as etcd binary This fixes so that the ENV vars are taken in the same way as for etcd binary. --- build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sh b/build.sh index 66d78973a..b8d1709da 100755 --- a/build.sh +++ b/build.sh @@ -51,7 +51,7 @@ etcd_build() { # shellcheck disable=SC2086 ( cd ./etcdctl - run env CGO_ENABLED=0 GO_BUILD_FLAGS="${GO_BUILD_FLAGS}" go build $GO_BUILD_FLAGS \ + run env GO_BUILD_FLAGS="${GO_BUILD_FLAGS}" "${GO_BUILD_ENV[@]}" go build $GO_BUILD_FLAGS \ -installsuffix=cgo \ "-ldflags=${GO_LDFLAGS[*]}" \ -o="../${out}/etcdctl" . || return 2