初始化提交

This commit is contained in:
2025-12-14 15:25:31 +08:00
commit 4fa42f7115
48 changed files with 8718 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
#!/bin/bash
# 编译脚本 - 兼容旧版本 GLIBC
echo "开始编译 mengyamonitor-backend..."
# 禁用 CGO使用纯 Go 编译(不依赖系统 C 库)
export CGO_ENABLED=0
# 设置目标平台
export GOOS=linux
export GOARCH=amd64
# 编译(静态链接)
go build -ldflags="-s -w" -o mengyamonitor-backend .
if [ $? -eq 0 ]; then
echo "编译成功!"
echo "二进制文件: mengyamonitor-backend"
echo ""
echo "检查文件信息:"
file mengyamonitor-backend
echo ""
echo "检查依赖库:"
ldd mengyamonitor-backend 2>/dev/null || echo "静态链接,无外部依赖"
else
echo "编译失败!"
exit 1
fi