Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: source_compile.md文件内关于agent编译部分更新 #11286

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 39 additions & 18 deletions docs/overview/source_compile.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,27 +35,48 @@ yarn public

### 编译

- 不要使用交叉编译生成 agent 程序。
- 安装好golang后,将 `bk-ci/src/agent` 加入 `GOPATH` 环境变量。
- Linux版本编译: build_linux.sh
- Windows版本编译: build_windows.bat
- MacOS 版本编译: build_macos.sh
- 输出在agent/bin目录下以下文件(安装包):

```
|- devopsAgent.exe
|- devopsAgent_linux
|- devopsAgent_macos
|- devopsDaemon.exe
|- devopsDaemon_linux
|- devopsDaemon_macos
|- upgrader.exe
|- upgrader_linux
|- upgrader_linux
备注:编译macos平台可执行文件时,若不开启cgo,则会影响采集cpu和diskio数据,这是因为Telegraf 的 cpu和diskio 插件采集使用的 shirou 包需要开启cgo才可以在darwin情况下采集成功

前置条件:进入agent根目录 -> `cd bk-ci/src/agent`

- linux平台 & mac平台编译
- 交叉编译多平台可执行文件(无cgo):make all
- 编译linux平台可执行文件(无cgo):make linux
- 编译win平台可执行文件(无cgo):make windows
- 编译mac平台可执行文件(无cgo):make macos_no_cgo
- 编译mac平台可执行文件(cgo):make macos_cgo
- windows平台编译
- 编译win平台可执行文件(无cgo):build_windows.bat
- 可执行文件统一输出在agent/bin目录下:
```shell
.
├── devopsAgent.exe
├── devopsAgent_linux
├── devopsAgent_linux_arm64
├── devopsAgent_linux_mips64
├── devopsAgent_macos
├── devopsAgent_macos_arm64
├── devopsDaemon.exe
├── devopsDaemon_linux
├── devopsDaemon_linux_arm64
├── devopsDaemon_linux_mips64
├── devopsDaemon_macos
├── devopsDaemon_macos_arm64
├── installer.exe
├── installer_linux
├── installer_linux_arm64
├── installer_linux_mips64
├── installer_macos
├── installer_macos_arm64
├── upgrader.exe
├── upgrader_linux
├── upgrader_linux_arm64
├── upgrader_linux_mips64
├── upgrader_macos
└── upgrader_macos_arm64
```



## backend后端微服务编译(kotlin)

### 系统要求
Expand Down