forked from robustmq/robustmq
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile
More file actions
99 lines (83 loc) · 3.4 KB
/
makefile
File metadata and controls
99 lines (83 loc) · 3.4 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
93
94
95
96
97
98
99
# Copyright 2023 RobustMQ Team
# Makefile for RobustMQ development and build tasks
VERSION := $(shell grep '^version = ' Cargo.toml | head -n1 | cut -d'"' -f2)
##@ Development
.PHONY: run
run: ## Run broker-server in development mode
cargo run --package cmd --bin broker-server
.PHONY: codecheck
codecheck: ## Run all code quality checks (format, check, clippy, license, docs)
@echo "Running code quality checks..."
hawkeye format
cargo fmt --all
cargo fmt --all -- --check
cargo check --workspace
cargo clippy --workspace --all-targets --tests -- -D warnings
cargo-deny check licenses
@echo "Building documentation..."
npm run docs:build
@echo "✅ All checks passed!"
.PHONY: doc
doc: ## Generate documentation
cargo doc --workspace --no-deps --open
##@ Build
.PHONY: build
build: ## Build current platform package (basic build without frontend)
@echo "Building current platform package..."
./scripts/build.sh
.PHONY: build-full
build-full: ## Build complete package with frontend (auto-clone frontend repo, build web UI, create tarball)
@echo "Building complete package with frontend..."
@echo "This will:"
@echo " • Clone robustmq-copilot frontend repository"
@echo " • Build web UI with pnpm"
@echo " • Compile Rust binaries in release mode"
@echo " • Create package: build/robustmq-{version}-{platform}.tar.gz"
./scripts/build.sh --with-frontend
.PHONY: build-version
build-version: ## Build package with specific version (usage: make build-version VERSION=v0.1.30)
@echo "Building package with version: $(VERSION)"
./scripts/build.sh --version $(VERSION)
##@ Release
.PHONY: release
release: ## Create new GitHub release and upload package
@echo "Creating new GitHub release..."
@echo "This will:"
@echo " • Create GitHub release with current version"
@echo " • Build and upload package for current platform"
@echo " • Requires GITHUB_TOKEN environment variable"
./scripts/release.sh
.PHONY: release-docker
release-docker: ## Build and push application image to GHCR
@echo "Building application image for GHCR (org=robustmq, version=$(VERSION))..."
./scripts/build-and-push-app.sh --org robustmq --version $(VERSION) --registry ghcr --push-latest
.PHONY: release-version
release-version: ## Create new GitHub release with specific version (usage: make release-version VERSION=v0.1.30)
@echo "Creating GitHub release with version: $(VERSION)"
./scripts/release.sh --version $(VERSION)
##@ Test
.PHONY: test
test: ## Run unit tests with cleanup
@echo "Running unit tests..."
cargo nextest run --workspace \
--exclude=robustmq-test \
--exclude=grpc-clients \
--filter-expr '!(test(meta) & package(storage-adapter))'
.PHONY: ig-test
ig-test: ## Run integration tests (assumes broker is already running)
@echo "Running integration tests (broker must be running)..."
/bin/bash ./scripts/ig-test.sh
.PHONY: ig-test-ci
ig-test-ci: ## Run integration tests with broker startup (for CI)
@echo "Running integration tests with broker startup..."
/bin/bash ./scripts/ig-test.sh --start-broker
##@ Clean
.PHONY: clean
clean: ## Clean all build artifacts
cargo clean
rm -rf build
##@ Help
.PHONY: help
help: ## Display this help message
@awk 'BEGIN {FS = ":.*##"; printf "\n\033[1mUsage:\033[0m\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z_0-9-]+:.*?##/ { printf " \033[36m%-20s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)
.DEFAULT_GOAL := help