Files
Logan.Li e0d652d211 feat: 完善堡垒机与 Agent 智能运维能力
- 支持 Windows Agent 构建、安装脚本和统一上报协议

- 增强 RDP 剪贴板、虚拟盘和文件传输能力

- 新增 AIOps 上下文工具、告警 RCA trace 落库和回放接口

- 重构 docs 模块文档并补充终端、堡垒机、监控、AI Agent 设计
2026-07-05 23:49:36 +08:00

65 lines
1.9 KiB
Makefile
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Makefile for AIOps Agent
# 提供本地构建、交叉编译及常用开发任务
# 署名 Logan.Li
APP := aiops-agent
VERSION := 1.0.0
BUILD_TIME := $(shell date -u +%Y-%m-%dT%H:%M:%SZ)
# 注入版本信息;-s -w 去除调试符号以缩减二进制体积
LDFLAGS := -s -w -X main.version=$(VERSION) -X main.buildTime=$(BUILD_TIME)
# 静态编译:关闭 CGO 并使用静态链接
LINUX_LDFLAGS := -extldflags "-static"
.PHONY: build cross build-linux-amd64 build-linux-arm64 build-darwin-arm64 build-windows-amd64 tidy run fmt vet clean help
## build: 本地构建当前平台二进制
build:
go build -ldflags "$(LDFLAGS)" -o $(APP) .
## cross: 交叉编译 Linux amd64/arm64 + macOS arm64 + Windows amd64 // Logan.Li
cross: build-linux-amd64 build-linux-arm64 build-darwin-arm64 build-windows-amd64
## build-linux-amd64: 交叉编译 linux/amd64
build-linux-amd64:
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 \
go build -ldflags "$(LDFLAGS) $(LINUX_LDFLAGS)" -o bin/$(APP)-linux-amd64 .
## build-linux-arm64: 交叉编译 linux/arm64
build-linux-arm64:
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 \
go build -ldflags "$(LDFLAGS) $(LINUX_LDFLAGS)" -o bin/$(APP)-linux-arm64 .
## build-darwin-arm64: 编译 macOS/arm64 (Apple Silicon) // Logan.Li
build-darwin-arm64:
CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 \
go build -ldflags "$(LDFLAGS)" -o bin/$(APP)-darwin-arm64 .
## build-windows-amd64: 编译 Windows/amd64 Agent // Logan.Li
build-windows-amd64:
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 \
go build -ldflags "$(LDFLAGS)" -o bin/$(APP)-windows-amd64.exe .
## tidy: 整理依赖
tidy:
go mod tidy
## run: 本地运行(默认连接 localhost:8080)
run:
go run . -server http://localhost:8080 -interval 10
## fmt: 格式化代码
fmt:
go fmt ./...
## vet: 静态检查
vet:
go vet ./...
## clean: 清理构建产物
clean:
rm -rf bin $(APP)
## help: 显示帮助
help:
@grep -E '^## ' $(MAKEFILE_LIST) | sed 's/## //' | column -t -s ':'