Files
mfd-monitor-agent/scripts/build-all.sh
codex de3fd88948 ✨ feat(agent): 添加 token 鉴权和流程文档
* 默认监听调整为 0.0.0.0:8080,并要求查询参数 token
* 支持首次 run 自动生成含随机 token 的配置文件
* 补充 HTTP 鉴权、配置校验和相关测试
* 完善代码注释,覆盖缓存、上报、服务和平台采集路径
* 新增架构与开发流程文档,补充一键构建脚本
2026-05-22 06:46:21 +00:00

28 lines
817 B
Bash
Executable File
Raw 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.

#!/usr/bin/env bash
# 一键构建 Linux + Windows amd64 单二进制产物。
#
# 环境变量(会传递给子脚本 build-linux.sh):
# OUT_DIR 输出目录,默认 <仓库根>/dist
# VERSION 写入二进制的版本号,默认 0.1.0
# CGO_ENABLED 是否启用 CGO,默认 0
#
# 用法:
# ./scripts/build-all.sh
# VERSION=1.0.0 ./scripts/build-all.sh
#
set -euo pipefail
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
BUILD_LINUX="${ROOT_DIR}/scripts/build-linux.sh"
export OUT_DIR="${OUT_DIR:-${ROOT_DIR}/dist}"
export VERSION="${VERSION:-0.1.0}"
export CGO_ENABLED="${CGO_ENABLED:-0}"
"${BUILD_LINUX}"
GOOS_TARGET=windows GOARCH_TARGET=amd64 OUTPUT_NAME=agent-windows-amd64.exe \
"${BUILD_LINUX}"
printf 'all platforms built under %s\n' "${OUT_DIR}"