forked from VictoriaMetrics/VictoriaLogs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile.whamcloud
More file actions
92 lines (80 loc) · 3.89 KB
/
Makefile.whamcloud
File metadata and controls
92 lines (80 loc) · 3.89 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# whamCloud Custom Makefile for VictoriaLogs
# This file is separate from the upstream Makefile to avoid merge conflicts
# when syncing with upstream VictoriaMetrics/VictoriaLogs
# Include the main Makefile for base targets
include Makefile
# whamCloud specific variables
# Allow VERSION to override WHAMCLOUD_VERSION
ifdef VERSION
WHAMCLOUD_VERSION := $(VERSION)
else
WHAMCLOUD_VERSION ?= 1.0.0
endif
WHAMCLOUD_PKG_TAG := v$(WHAMCLOUD_VERSION)
# Override PKG_TAG for whamCloud builds
export PKG_TAG := $(WHAMCLOUD_PKG_TAG)
# Override TAR_OWNERSHIP for macOS compatibility
# macOS uses BSD tar which doesn't support --owner/--group
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Darwin)
override TAR_OWNERSHIP :=
endif
.PHONY: whamcloud-release whamcloud-clean whamcloud-release-victoria-logs-linux-amd64 whamcloud-release-vlutils-linux-amd64
# Main target to build all tarballs
whamcloud-release: whamcloud-clean
@echo "Building whamCloud VictoriaLogs $(WHAMCLOUD_PKG_TAG) for linux-amd64..."
@$(MAKE) -f Makefile.whamcloud whamcloud-release-victoria-logs-linux-amd64 WHAMCLOUD_VERSION=$(WHAMCLOUD_VERSION)
@$(MAKE) -f Makefile.whamcloud whamcloud-release-vlutils-linux-amd64 WHAMCLOUD_VERSION=$(WHAMCLOUD_VERSION)
@echo "Build complete! Tarballs are in bin/"
@ls -lh bin/*-$(WHAMCLOUD_PKG_TAG).tar.gz
# Build victoria-logs for linux-amd64
whamcloud-release-victoria-logs-linux-amd64:
@echo "Building victoria-logs for linux-amd64..."
GOOS=linux GOARCH=amd64 $(MAKE) victoria-logs-linux-amd64-prod
@echo "Creating tarball..."
cd bin && \
cp victoria-logs-linux-amd64-prod victoria-logs-prod && \
tar $(TAR_OWNERSHIP) -czf victoria-logs-linux-amd64-$(WHAMCLOUD_PKG_TAG).tar.gz victoria-logs-prod && \
sha256sum victoria-logs-linux-amd64-$(WHAMCLOUD_PKG_TAG).tar.gz \
> victoria-logs-linux-amd64-$(WHAMCLOUD_PKG_TAG)_checksums.txt
@echo "Keeping binaries for RPM building..."
@echo "Note: victoria-logs-linux-amd64-prod kept in bin/ for RPM packaging"
# Build vlutils (vlagent + vlogscli) for linux-amd64
whamcloud-release-vlutils-linux-amd64:
@echo "Building vlutils (vlagent + vlogscli) for linux-amd64..."
GOOS=linux GOARCH=amd64 $(MAKE) vlagent-linux-amd64-prod
GOOS=linux GOARCH=amd64 $(MAKE) vlogscli-linux-amd64-prod
@echo "Creating vlutils tarball..."
cd bin && \
cp vlagent-linux-amd64-prod vlagent-prod && \
cp vlogscli-linux-amd64-prod vlogscli-prod && \
tar $(TAR_OWNERSHIP) -czf vlutils-linux-amd64-$(WHAMCLOUD_PKG_TAG).tar.gz vlagent-prod vlogscli-prod && \
sha256sum vlutils-linux-amd64-$(WHAMCLOUD_PKG_TAG).tar.gz vlagent-prod vlogscli-prod \
| sed 's/-linux-amd64-prod/-prod/' > vlutils-linux-amd64-$(WHAMCLOUD_PKG_TAG)_checksums.txt
@echo "Keeping binaries for RPM building..."
@echo "Note: vlagent-linux-amd64-prod and vlogscli-linux-amd64-prod kept in bin/ for RPM packaging"
# Clean whamCloud build artifacts
whamcloud-clean:
@echo "Cleaning whamCloud build artifacts..."
rm -f bin/victoria-logs-linux-amd64-$(WHAMCLOUD_PKG_TAG).tar.gz
rm -f bin/victoria-logs-linux-amd64-$(WHAMCLOUD_PKG_TAG)_checksums.txt
rm -f bin/vlutils-linux-amd64-$(WHAMCLOUD_PKG_TAG).tar.gz
rm -f bin/vlutils-linux-amd64-$(WHAMCLOUD_PKG_TAG)_checksums.txt
# Build with custom version
whamcloud-release-version:
ifndef VERSION
$(error VERSION is not set. Usage: make whamcloud-release-version VERSION=1.0.1)
endif
WHAMCLOUD_VERSION=$(VERSION) $(MAKE) whamcloud-release
# Help target
whamcloud-help:
@echo "whamCloud VictoriaLogs Build Targets:"
@echo ""
@echo " whamcloud-release - Build all tarballs for linux-amd64"
@echo " whamcloud-release-version VERSION=X - Build with custom version number"
@echo " whamcloud-clean - Clean whamCloud build artifacts"
@echo ""
@echo "Current version: $(WHAMCLOUD_PKG_TAG)"
@echo "Output:"
@echo " - victoria-logs-linux-amd64-$(WHAMCLOUD_PKG_TAG).tar.gz"
@echo " - vlutils-linux-amd64-$(WHAMCLOUD_PKG_TAG).tar.gz (vlagent + vlogscli)"