Files
xk-ai-agent/Makefile
2026-08-14 21:50:48 +08:00

54 lines
830 B
Makefile

.PHONY: run build test clean docker-up docker-down
# 运行开发模式
run:
go run main.go
# 编译
build:
mkdir -p dist
CGO_ENABLED=0 GOOS=linux go build -o dist/tcm-agent main.go
# 运行测试
test:
go test -v -race -cover ./...
# 测试特定包
test-rule:
go test -v -run TestRule ./test/
test-agent:
go test -v -run TestAgent ./test/
# 代码格式化
fmt:
go fmt ./...
# 静态检查
lint:
golangci-lint run ./...
# 清理
clean:
rm -rf dist/
go clean
# Docker 相关
docker-up:
docker-compose -f manifest/docker/docker-compose.yml up -d
docker-down:
docker-compose -f manifest/docker/docker-compose.yml down
docker-logs:
docker-compose -f manifest/docker/docker-compose.yml logs -f
# 运行模拟演示
simulate:
go run examples/simulation.go
# 安装依赖
deps:
go mod tidy
go mod download