Files
mengyamonitor/mengyamonitor-backend-server/build-linux-amd64.bat
2026-05-16 19:03:34 +08:00

29 lines
679 B
Batchfile
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.
@echo off
setlocal
cd /d "%~dp0"
where go >nul 2>&1
if errorlevel 1 (
echo [错误] 未找到 go请先安装 Go 并加入 PATH
exit /b 1
)
if not exist release mkdir release
set GOOS=linux
set GOARCH=amd64
set CGO_ENABLED=0
echo 正在编译 Linux amd64 release\mengyamonitor-central-linux-amd64 ...
go build -trimpath -ldflags="-s -w" -o release\mengyamonitor-central-linux-amd64 .
if errorlevel 1 (
echo [错误] go build 失败
exit /b 1
)
echo 完成: %cd%\release\mengyamonitor-central-linux-amd64
echo.
echo 可选:用预编译镜像启动(不再在 Docker 里编译)
echo docker compose -f docker-compose.binary.yml up -d --build
exit /b 0