From b6b77145f99e1b7f940e16ff0cdf780d6bae4a26 Mon Sep 17 00:00:00 2001 From: Xiang Dai Date: Tue, 18 Aug 2020 09:52:43 +0800 Subject: [PATCH 01/12] Support build docker images for arm64 arch Signed-off-by: Xiang Dai --- .circleci/config.yml | 12 +++++++----- Dockerfile.multi-arch | 8 ++++++++ Makefile | 31 +++++++++++++++++++++++++++++-- 3 files changed, 44 insertions(+), 7 deletions(-) create mode 100644 Dockerfile.multi-arch diff --git a/.circleci/config.yml b/.circleci/config.yml index 68bf7cdb08..3c65771aa3 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -22,7 +22,7 @@ jobs: - checkout - go/mod-download-cached - setup_remote_docker: - version: 17.07.0-ce + version: 18.06.0-ce - run: name: Create Secret if PR is not forked # GCS integration tests are run only for author's PR that have write access, because these tests @@ -74,12 +74,14 @@ jobs: - checkout - go/mod-download-cached - setup_remote_docker: - version: 17.07.0-ce + version: 18.06.0-ce - attach_workspace: at: . - - run: ln -s .build/linux-amd64/thanos thanos - - run: make docker - - run: docker run thanos --help + # register qemu to support mulit-arch + - run: docker run --privileged linuxkit/binfmt:v0.7 + - run: make docker-build + - run: make docker-test + - run: make docker-manifest # Upload to both dockerhub and quay.io. - run: echo "${DOCKERHUB_PASSWORD}" | docker login -u="${DOCKERHUB_USERNAME}" --password-stdin - run: make docker-push DOCKER_IMAGE_REPO=thanosio/thanos diff --git a/Dockerfile.multi-arch b/Dockerfile.multi-arch new file mode 100644 index 0000000000..9e85301a0b --- /dev/null +++ b/Dockerfile.multi-arch @@ -0,0 +1,8 @@ +ARG OS="linux" +ARG ARCH="amd64" +FROM quay.io/prometheus/busybox-${OS}-${ARCH}:latest +LABEL maintainer="The Thanos Authors" + +COPY .build/${OS}-${ARCH}/thanos /bin/thanos + +ENTRYPOINT [ "/bin/thanos" ] diff --git a/Makefile b/Makefile index c01c3e4e4e..b0282e2665 100644 --- a/Makefile +++ b/Makefile @@ -21,6 +21,12 @@ else ifeq ($(arch), armv8) else echo >&2 "only support amd64 or arm64 arch" && exit 1 endif +DOCKER_ARCHS ?= amd64 arm64 +# Generate two target: docker-xxx-amd64, docker-xxx-arm64. +# Run make docker-xxx -n to see the result with dry run. +BUILD_DOCKER_ARCHS = $(addprefix docker-build-,$(DOCKER_ARCHS)) +TEST_DOCKER_ARCHS = $(addprefix docker-test-,$(DOCKER_ARCHS)) +PUSH_DOCKER_ARCHS = $(addprefix docker-push-,$(DOCKER_ARCHS)) # Ensure everything works even if GOPATH is not set, which is often the case. # The `go env GOPATH` will work for all cases for Go 1.8+. @@ -164,9 +170,30 @@ docker-multi-stage: @echo ">> building docker image 'thanos' with Dockerfile.multi-stage" @docker build -f Dockerfile.multi-stage -t "thanos" --build-arg BASE_DOCKER_SHA=$(BASE_DOCKER_SHA) . -.PHONY: docker-push +# docker-build builds docker images with multiple architectures. +.PHONY: docker-build $(BUILD_DOCKER_ARCHS) +docker-build: $(BUILD_DOCKER_ARCHS) +$(BUILD_DOCKER_ARCHS): docker-build-%: + @docker build -t "$(DOCKER_IMAGE_REPO)-linux-$*:$(DOCKER_IMAGE_TAG)" \ + --build-arg ARCH="$*" --build-arg OS="linux" -f Dockerfile.multi-arch . + +.PHONY: docker-test $(TEST_DOCKER_ARCHS) +docker-test: $(TEST_DOCKER_ARCHS) +$(TEST_DOCKER_ARCHS): docker-test-%: + @echo ">> testing image" + @docker run "$(DOCKER_IMAGE_REPO)-linux-$*:$(DOCKER_IMAGE_TAG)" --help + +# docker-manifest push docker manifest to support multiple architectures. +.PHONY: docker-manifest +docker-manifest: + @echo ">> creating and pushing manifest" + @DOCKER_CLI_EXPERIMENTAL=enabled docker manifest create -a "$(DOCKER_IMAGE_REPO):$(DOCKER_IMAGE_TAG)" $(foreach ARCH,$(DOCKER_ARCHS),$(DOCKER_IMAGE_REPO)-linux-$(ARCH):$(DOCKER_IMAGE_TAG)) + @DOCKER_CLI_EXPERIMENTAL=enabled docker manifest push "$(DOCKER_IMAGE_REPO):$(DOCKER_IMAGE_TAG)" + +.PHONY: docker-push $(PUSH_DOCKER_ARCHS) docker-push: ## Pushes 'thanos' docker image build to "$(DOCKER_IMAGE_REPO):$(DOCKER_IMAGE_TAG)". -docker-push: +docker-push: $(PUSH_DOCKER_ARCHS) +$(PUSH_DOCKER_ARCHS): docker-push-%: @echo ">> pushing image" @docker tag "thanos" "$(DOCKER_IMAGE_REPO):$(DOCKER_IMAGE_TAG)" @docker push "$(DOCKER_IMAGE_REPO):$(DOCKER_IMAGE_TAG)" From cca6e0585dfdd6809aa4706d30fce36a10f1e835 Mon Sep 17 00:00:00 2001 From: Long Dai Date: Thu, 24 Jun 2021 00:24:34 -0700 Subject: [PATCH 02/12] Use Dockerfile.multi-stage Signed-off-by: Long Dai --- Dockerfile.multi-arch | 8 -------- Makefile | 9 ++++++--- 2 files changed, 6 insertions(+), 11 deletions(-) delete mode 100644 Dockerfile.multi-arch diff --git a/Dockerfile.multi-arch b/Dockerfile.multi-arch deleted file mode 100644 index 9e85301a0b..0000000000 --- a/Dockerfile.multi-arch +++ /dev/null @@ -1,8 +0,0 @@ -ARG OS="linux" -ARG ARCH="amd64" -FROM quay.io/prometheus/busybox-${OS}-${ARCH}:latest -LABEL maintainer="The Thanos Authors" - -COPY .build/${OS}-${ARCH}/thanos /bin/thanos - -ENTRYPOINT [ "/bin/thanos" ] diff --git a/Makefile b/Makefile index b0282e2665..312412a04b 100644 --- a/Makefile +++ b/Makefile @@ -12,12 +12,14 @@ arch = $(shell uname -m) # just visit https://quay.io/repository/prometheus/busybox?tag=latest&tab=tags. # TODO(bwplotka): Pinning is important but somehow quay kills the old images, so make sure to update regularly. # Update at 2021.6.07 +ARM64_SHA="de4af55df1f648a334e16437c550a2907e0aed4f0b0edf454b0b215a9349bdbb" +AMD64_SHA="5591971699f6cf8abf6776495385e9d62751111a8cba56bf4946cf1d0de425ed" ifeq ($(arch), x86_64) # amd64 - BASE_DOCKER_SHA="de4af55df1f648a334e16437c550a2907e0aed4f0b0edf454b0b215a9349bdbb" + BASE_DOCKER_SHA=$(AMD64_SHA) else ifeq ($(arch), armv8) # arm64 - BASE_DOCKER_SHA="5591971699f6cf8abf6776495385e9d62751111a8cba56bf4946cf1d0de425ed" + BASE_DOCKER_SHA=$(ARM64_SHA) else echo >&2 "only support amd64 or arm64 arch" && exit 1 endif @@ -170,12 +172,13 @@ docker-multi-stage: @echo ">> building docker image 'thanos' with Dockerfile.multi-stage" @docker build -f Dockerfile.multi-stage -t "thanos" --build-arg BASE_DOCKER_SHA=$(BASE_DOCKER_SHA) . +GET_SHA = $(shell echo '$1'_SHA | tr '[:lower:]' '[:upper:]') # docker-build builds docker images with multiple architectures. .PHONY: docker-build $(BUILD_DOCKER_ARCHS) docker-build: $(BUILD_DOCKER_ARCHS) $(BUILD_DOCKER_ARCHS): docker-build-%: @docker build -t "$(DOCKER_IMAGE_REPO)-linux-$*:$(DOCKER_IMAGE_TAG)" \ - --build-arg ARCH="$*" --build-arg OS="linux" -f Dockerfile.multi-arch . + --build-arg BASE_DOCKER_SHA=$($(call GET_SHA,$*)) -f Dockerfile.multi-stage . .PHONY: docker-test $(TEST_DOCKER_ARCHS) docker-test: $(TEST_DOCKER_ARCHS) From efdcf1adb135e5652f129fdb7471b97579331b3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Giedrius=20Statkevi=C4=8Dius?= Date: Mon, 26 Jul 2021 18:42:47 +0300 Subject: [PATCH 03/12] CHANGELOG: fix entry MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Giedrius Statkevičius --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index abd540da48..61a6eda332 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -397,7 +397,11 @@ Highlights: - [#2973](https://github.com/thanos-io/thanos/pull/2973) Add Thanos Query Frontend component. - [#2980](https://github.com/thanos-io/thanos/pull/2980) Bucket Viewer: Migrate block viewer to React. - [#2725](https://github.com/thanos-io/thanos/pull/2725) Add bucket index operation durations: `thanos_bucket_store_cached_series_fetch_duration_seconds` and `thanos_bucket_store_cached_postings_fetch_duration_seconds`. +<<<<<<< HEAD - [#2931](https://github.com/thanos-io/thanos/pull/2931) Query: Allow passing a `storeMatch[]` to select matching stores when debugging the querier. See [documentation](docs/components/query.md#store-filtering) +======= +- [#2931](https://github.com/thanos-io/thanos/pull/2931) Query: Allow passing a `storeMatch[]` to select matching stores when debugging the querier. See [documentation](https://thanos.io/tip/components/query.md/#store-filtering) +>>>>>>> CHANGELOG: fix entry ### Changed From 608132b80dac8e6f4a8b28d78af35a24300c74a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Giedrius=20Statkevi=C4=8Dius?= Date: Mon, 26 Jul 2021 18:51:09 +0300 Subject: [PATCH 04/12] Makefile: fix SHA values MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Giedrius Statkevičius --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 312412a04b..76d5b536f2 100644 --- a/Makefile +++ b/Makefile @@ -12,8 +12,8 @@ arch = $(shell uname -m) # just visit https://quay.io/repository/prometheus/busybox?tag=latest&tab=tags. # TODO(bwplotka): Pinning is important but somehow quay kills the old images, so make sure to update regularly. # Update at 2021.6.07 -ARM64_SHA="de4af55df1f648a334e16437c550a2907e0aed4f0b0edf454b0b215a9349bdbb" -AMD64_SHA="5591971699f6cf8abf6776495385e9d62751111a8cba56bf4946cf1d0de425ed" +AMD64_SHA="de4af55df1f648a334e16437c550a2907e0aed4f0b0edf454b0b215a9349bdbb" +ARM64_SHA="5591971699f6cf8abf6776495385e9d62751111a8cba56bf4946cf1d0de425ed" ifeq ($(arch), x86_64) # amd64 BASE_DOCKER_SHA=$(AMD64_SHA) From fcb39ab3e1bc524af5f606d963fa83d1d4567a64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Giedrius=20Statkevi=C4=8Dius?= Date: Mon, 26 Jul 2021 23:30:27 +0300 Subject: [PATCH 05/12] .circleci: create new manifest after pushing image MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Only create a manifest & push it after pushing images with the new names. Signed-off-by: Giedrius Statkevičius --- .circleci/config.yml | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 3c65771aa3..ca8cdc9260 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -77,16 +77,17 @@ jobs: version: 18.06.0-ce - attach_workspace: at: . - # register qemu to support mulit-arch + # Register qemu to support multi-arch. - run: docker run --privileged linuxkit/binfmt:v0.7 - run: make docker-build - run: make docker-test - - run: make docker-manifest # Upload to both dockerhub and quay.io. - run: echo "${DOCKERHUB_PASSWORD}" | docker login -u="${DOCKERHUB_USERNAME}" --password-stdin - run: make docker-push DOCKER_IMAGE_REPO=thanosio/thanos + - run: make docker-manifest DOCKER_IMAGE_REPO=thanosio/thanos - run: echo "${QUAY_PASSWORD}" | docker login -u="${QUAY_USERNAME}" quay.io --password-stdin - run: make docker-push + - run: make docker-manifest publish_release: executor: golang @@ -94,21 +95,25 @@ jobs: - checkout - go/mod-download-cached - setup_remote_docker: - version: 17.07.0-ce + version: 18.06.0-ce - attach_workspace: at: . - run: make tarballs-release - store_artifacts: path: .tarballs destination: releases + # Register qemu to support multi-arch. + - run: docker run --privileged linuxkit/binfmt:v0.7 - run: ln -s .build/linux-amd64/thanos thanos - - run: make docker - - run: docker run thanos --help + - run: make docker-build + - run: make docker-test # Upload to both dockerhub and quay.io. - run: echo "${DOCKERHUB_PASSWORD}" | docker login -u="${DOCKERHUB_USERNAME}" --password-stdin - run: make docker-push DOCKER_IMAGE_REPO=thanosio/thanos DOCKER_IMAGE_TAG=$CIRCLE_TAG + - run: make docker-manifest DOCKER_IMAGE_REPO=thanosio/thanos DOCKER_IMAGE_TAG=$CIRCLE_TAG - run: echo "${QUAY_PASSWORD}" | docker login -u="${QUAY_USERNAME}" quay.io --password-stdin - run: make docker-push DOCKER_IMAGE_TAG=$CIRCLE_TAG + - run: make docker-manifest DOCKER_IMAGE_TAG=$CIRCLE_TAG workflows: version: 2 From 520b5bf49839c1477426e527fb1a62ebc0523786 Mon Sep 17 00:00:00 2001 From: Loong Date: Tue, 7 Dec 2021 12:55:51 +0000 Subject: [PATCH 06/12] fix revert issue Signed-off-by: Loong --- CHANGELOG.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 61a6eda332..abd540da48 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -397,11 +397,7 @@ Highlights: - [#2973](https://github.com/thanos-io/thanos/pull/2973) Add Thanos Query Frontend component. - [#2980](https://github.com/thanos-io/thanos/pull/2980) Bucket Viewer: Migrate block viewer to React. - [#2725](https://github.com/thanos-io/thanos/pull/2725) Add bucket index operation durations: `thanos_bucket_store_cached_series_fetch_duration_seconds` and `thanos_bucket_store_cached_postings_fetch_duration_seconds`. -<<<<<<< HEAD - [#2931](https://github.com/thanos-io/thanos/pull/2931) Query: Allow passing a `storeMatch[]` to select matching stores when debugging the querier. See [documentation](docs/components/query.md#store-filtering) -======= -- [#2931](https://github.com/thanos-io/thanos/pull/2931) Query: Allow passing a `storeMatch[]` to select matching stores when debugging the querier. See [documentation](https://thanos.io/tip/components/query.md/#store-filtering) ->>>>>>> CHANGELOG: fix entry ### Changed From 853464aa1007724ef032d76664ae6d360fafa4fe Mon Sep 17 00:00:00 2001 From: Loong Date: Tue, 7 Dec 2021 13:11:59 +0000 Subject: [PATCH 07/12] update Signed-off-by: Loong --- .circleci/config.yml | 1 - Dockerfile.multi-arch | 12 ++++++++++++ Makefile | 4 +++- 3 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 Dockerfile.multi-arch diff --git a/.circleci/config.yml b/.circleci/config.yml index ca8cdc9260..a744238208 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -104,7 +104,6 @@ jobs: destination: releases # Register qemu to support multi-arch. - run: docker run --privileged linuxkit/binfmt:v0.7 - - run: ln -s .build/linux-amd64/thanos thanos - run: make docker-build - run: make docker-test # Upload to both dockerhub and quay.io. diff --git a/Dockerfile.multi-arch b/Dockerfile.multi-arch new file mode 100644 index 0000000000..11b7fc4ef8 --- /dev/null +++ b/Dockerfile.multi-arch @@ -0,0 +1,12 @@ +# By default we pin to amd64 sha. Use make docker to automatically adjust for arm64 versions. +ARG BASE_DOCKER_SHA="14d68ca3d69fceaa6224250c83d81d935c053fb13594c811038c461194599973" + +FROM quay.io/prometheus/busybox@sha256:${BASE_DOCKER_SHA} +LABEL maintainer="The Thanos Authors" + +ARG ARCH="amd64" +ARG OS="linux" + +COPY .build/${OS}-${ARCH}/thanos /bin/thanos + +ENTRYPOINT [ "/bin/thanos" ] diff --git a/Makefile b/Makefile index 76d5b536f2..f8de4f79a6 100644 --- a/Makefile +++ b/Makefile @@ -178,7 +178,9 @@ GET_SHA = $(shell echo '$1'_SHA | tr '[:lower:]' '[:upper:]') docker-build: $(BUILD_DOCKER_ARCHS) $(BUILD_DOCKER_ARCHS): docker-build-%: @docker build -t "$(DOCKER_IMAGE_REPO)-linux-$*:$(DOCKER_IMAGE_TAG)" \ - --build-arg BASE_DOCKER_SHA=$($(call GET_SHA,$*)) -f Dockerfile.multi-stage . + --build-arg BASE_DOCKER_SHA=$($(call GET_SHA,$*)) \ + --build-arg ARCH="$*" \ + -f Dockerfile.multi-arch . .PHONY: docker-test $(TEST_DOCKER_ARCHS) docker-test: $(TEST_DOCKER_ARCHS) From 7609f2de516410a71d0bb14eece5130ca4093bb4 Mon Sep 17 00:00:00 2001 From: Loong Date: Tue, 7 Dec 2021 13:13:20 +0000 Subject: [PATCH 08/12] add crossbuild Signed-off-by: Loong --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index a744238208..c176ab4547 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -79,6 +79,7 @@ jobs: at: . # Register qemu to support multi-arch. - run: docker run --privileged linuxkit/binfmt:v0.7 + - run: make crossbuild - run: make docker-build - run: make docker-test # Upload to both dockerhub and quay.io. From 9011daa3331f29d38b0bc26e00a3c0918dbe070b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Giedrius=20Statkevi=C4=8Dius?= Date: Fri, 10 Dec 2021 15:51:23 +0200 Subject: [PATCH 09/12] Dockerfile.multi-arch: update SHA MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Giedrius Statkevičius --- Dockerfile.multi-arch | 2 +- Makefile | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Dockerfile.multi-arch b/Dockerfile.multi-arch index 11b7fc4ef8..756b3e83c3 100644 --- a/Dockerfile.multi-arch +++ b/Dockerfile.multi-arch @@ -1,5 +1,5 @@ # By default we pin to amd64 sha. Use make docker to automatically adjust for arm64 versions. -ARG BASE_DOCKER_SHA="14d68ca3d69fceaa6224250c83d81d935c053fb13594c811038c461194599973" +ARG BASE_DOCKER_SHA="97a9aacc097e5dbdec33b0d671adea0785e76d26ff2b979ee28570baf6a9155d" FROM quay.io/prometheus/busybox@sha256:${BASE_DOCKER_SHA} LABEL maintainer="The Thanos Authors" diff --git a/Makefile b/Makefile index 2a22324a03..bfb6c80186 100644 --- a/Makefile +++ b/Makefile @@ -12,12 +12,15 @@ arch = $(shell uname -m) # just visit https://quay.io/repository/prometheus/busybox?tag=latest&tab=tags. # TODO(bwplotka): Pinning is important but somehow quay kills the old images, so make sure to update regularly. # Update at 2021.12.08 +AMD64_SHA="97a9aacc097e5dbdec33b0d671adea0785e76d26ff2b979ee28570baf6a9155d" +ARM64_SHA="5feb736d32e5b57f4944691d00b581f1f9192b3732cab03e3b6034cf0d1c8f2c" + ifeq ($(arch), x86_64) # amd64 - BASE_DOCKER_SHA="97a9aacc097e5dbdec33b0d671adea0785e76d26ff2b979ee28570baf6a9155d" + BASE_DOCKER_SHA=$(AMD64_SHA) else ifeq ($(arch), armv8) # arm64 - BASE_DOCKER_SHA="5feb736d32e5b57f4944691d00b581f1f9192b3732cab03e3b6034cf0d1c8f2c" + BASE_DOCKER_SHA=$(ARM64_SHA) else echo >&2 "only support amd64 or arm64 arch" && exit 1 endif From f25e5fc83738778c95698c2cd5df203fc4eaeecd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Giedrius=20Statkevi=C4=8Dius?= Date: Fri, 10 Dec 2021 16:48:32 +0200 Subject: [PATCH 10/12] .dockerignore: remove .promu MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Giedrius Statkevičius --- .dockerignore | 1 - 1 file changed, 1 deletion(-) diff --git a/.dockerignore b/.dockerignore index a5c7d42778..eb6683233e 100644 --- a/.dockerignore +++ b/.dockerignore @@ -14,7 +14,6 @@ data/ test/e2e/e2e_integration_test* # Ignore promu artifacts. -/.build /.release /.tarballs From 197b2fc8f99519bff9b1e9c3578cc8dfe8c26ee3 Mon Sep 17 00:00:00 2001 From: Loong Date: Mon, 13 Dec 2021 10:10:23 +0000 Subject: [PATCH 11/12] add logic for main Signed-off-by: Loong --- Makefile | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Makefile b/Makefile index bfb6c80186..b895b72c22 100644 --- a/Makefile +++ b/Makefile @@ -143,11 +143,20 @@ build: check-git deps $(PROMU) @echo ">> building Thanos binary in $(PREFIX)" @$(PROMU) build --prefix $(PREFIX) +GIT_BRANCH=$(GIT) rev-parse --abbrev-ref HEAD .PHONY: crossbuild crossbuild: ## Builds all binaries for all platforms. +ifeq ($(GIT_BRANCH), main) +crossbuild: | $(PROMU) + @echo ">> crossbuilding all binaries" + # we only care about below two for the main branch + $(PROMU) crossbuild -v -p linux/amd64 -p linux/arm64 +else crossbuild: | $(PROMU) @echo ">> crossbuilding all binaries" $(PROMU) crossbuild -v +endif + .PHONY: deps deps: ## Ensures fresh go.mod and go.sum. From 057777ed8e6e9e5fe6f66d0799766bfa4fb8c99a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Giedrius=20Statkevi=C4=8Dius?= Date: Mon, 13 Dec 2021 12:36:57 +0200 Subject: [PATCH 12/12] Makefile: use $(shell) for getting value MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Giedrius Statkevičius --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index b895b72c22..18b30b0f94 100644 --- a/Makefile +++ b/Makefile @@ -143,7 +143,7 @@ build: check-git deps $(PROMU) @echo ">> building Thanos binary in $(PREFIX)" @$(PROMU) build --prefix $(PREFIX) -GIT_BRANCH=$(GIT) rev-parse --abbrev-ref HEAD +GIT_BRANCH=$(shell $(GIT) rev-parse --abbrev-ref HEAD) .PHONY: crossbuild crossbuild: ## Builds all binaries for all platforms. ifeq ($(GIT_BRANCH), main)