Makefile: speedup release, publish and crossbuild rules by using parallel make

This commit is contained in:
Aliaksandr Valialkin 2023-11-20 22:51:33 +02:00
parent 46e58f3669
commit 6b75523468
No known key found for this signature in database
GPG Key ID: 52C003EE2BCDB9EB
3 changed files with 24 additions and 21 deletions

View File

@ -92,4 +92,4 @@ jobs:
- name: Build
run: |
make vmcluster-crossbuild
make crossbuild

View File

@ -1,5 +1,6 @@
PKG_PREFIX := github.com/VictoriaMetrics/VictoriaMetrics
MAKE_PARALLEL := $(MAKE) -j `cat /proc/cpuinfo | grep -c processor`
DATEINFO_TAG ?= $(shell date -u +'%Y%m%d-%H%M%S')
BUILDINFO_TAG ?= $(shell echo $$(git describe --long --all | tr '/' '-')$$( \
git diff-index --quiet HEAD -- || echo '-dirty-'$$(git diff-index -u HEAD | openssl sha1 | cut -d' ' -f2 | cut -c 1-8)))
@ -72,8 +73,10 @@ vmcluster-windows-amd64: \
vmselect-windows-amd64 \
vmstorage-windows-amd64
vmcluster-crossbuild: \
vmcluster-linux-amd64 \
crossbuild: vmcluster-crossbuild
vmcluster-crossbuild:
$(MAKE_PARALLEL) vmcluster-linux-amd64 \
vmcluster-linux-arm64 \
vmcluster-linux-arm \
vmcluster-linux-ppc64le \
@ -93,13 +96,13 @@ package: \
publish-release:
rm -rf bin/*
git checkout $(TAG) && LATEST_TAG=stable $(MAKE) release publish && \
git checkout $(TAG)-cluster && LATEST_TAG=cluster-stable $(MAKE) release publish && \
git checkout $(TAG)-enterprise && LATEST_TAG=enterprise-stable $(MAKE) release publish && \
git checkout $(TAG)-enterprise-cluster && LATEST_TAG=enterprise-cluster-stable $(MAKE) release publish
git checkout $(TAG) && $(MAKE) release && LATEST_TAG=stable $(MAKE) publish && \
git checkout $(TAG)-cluster && $(MAKE) release && LATEST_TAG=cluster-stable $(MAKE) publish && \
git checkout $(TAG)-enterprise && $(MAKE) release && LATEST_TAG=enterprise-stable $(MAKE) publish && \
git checkout $(TAG)-enterprise-cluster && $(MAKE) release && LATEST_TAG=enterprise-cluster-stable $(MAKE) publish
release: \
release-vmcluster
release:
$(MAKE_PARALLEL) release-vmcluster
release-vmcluster: \
release-vmcluster-linux-amd64 \

View File

@ -68,8 +68,8 @@ package-via-docker: package-base
--tag $(DOCKER_NAMESPACE)/$(APP_NAME):$(PKG_TAG)$(APP_SUFFIX)$(RACE) \
-f app/$(APP_NAME)/deployment/Dockerfile bin)
publish-via-docker: \
app-via-docker-linux-amd64 \
publish-via-docker:
$(MAKE_PARALLEL) app-via-docker-linux-amd64 \
app-via-docker-linux-arm \
app-via-docker-linux-arm64 \
app-via-docker-linux-ppc64le \