Skip to content

Commit

Permalink
Fixed promu build to build in compatible directory that crossbuild un…
Browse files Browse the repository at this point in the history
…derstands.

Signed-off-by: Bartlomiej Plotka <[email protected]>
  • Loading branch information
bwplotka committed May 22, 2020
1 parent 16d4eeb commit 8e763bf
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Build by default has to build in root, current directory. Only then promu crossbuild will work as expected.
PROMU_TARGET_DIR ?= $(shell pwd)
FILES_TO_FMT ?= $(shell find . -path ./vendor -prune -o -name '*.go' -print)

DOCKER_IMAGE_REPO ?= quay.io/thanos/thanos
Expand All @@ -10,6 +12,7 @@ GOPATH ?= $(shell go env GOPATH)

TMP_GOPATH ?= /tmp/thanos-go
GOBIN ?= $(firstword $(subst :, ,${GOPATH}))/bin

GO111MODULE ?= on
export GO111MODULE
GOPROXY ?= https://proxy.golang.org
Expand Down Expand Up @@ -174,8 +177,9 @@ react-app-start: $(REACT_APP_NODE_MODULES_PATH)
.PHONY: build
build: ## Builds Thanos binary using `promu`.
build: check-git deps $(PROMU)
@echo ">> building Thanos binary in $(GOBIN)"
@$(PROMU) build --prefix $(GOBIN)
@echo ">> building Thanos binary in $(PROMU_TARGET_DIR) and $(GOBIN)"
@$(PROMU) build --prefix $(PROMU_TARGET_DIR)
@cp ${PROMU_TARGET_DIR}/thanos $(GOBIN)/thanos

.PHONY: crossbuild
crossbuild: ## Builds all binaries for all platforms.
Expand Down

0 comments on commit 8e763bf

Please sign in to comment.