chore: sync local updates
This commit is contained in:
35
mengyaping-backend/build-linux-amd64.bat
Normal file
35
mengyaping-backend/build-linux-amd64.bat
Normal file
@@ -0,0 +1,35 @@
|
||||
@echo off
|
||||
chcp 65001 >nul 2>&1
|
||||
setlocal
|
||||
cd /d "%~dp0"
|
||||
|
||||
where go >nul 2>nul
|
||||
if errorlevel 1 (
|
||||
echo [ERROR] Go not found in PATH. Install Go and reopen the terminal.
|
||||
pause
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
set "DIST=dist"
|
||||
if not exist "%DIST%" mkdir "%DIST%"
|
||||
|
||||
set "GOOS=linux"
|
||||
set "GOARCH=amd64"
|
||||
set "CGO_ENABLED=0"
|
||||
|
||||
echo Cross-compile linux/amd64 -^> "%DIST%\mengyaping-backend"
|
||||
go version
|
||||
go build -trimpath -ldflags="-s -w" -o "%DIST%\mengyaping-backend" .
|
||||
if errorlevel 1 (
|
||||
echo.
|
||||
echo [ERROR] go build failed. See messages above.
|
||||
echo Tips: go.mod requires Go 1.25+; run from mengyaping-backend folder.
|
||||
pause
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
echo.
|
||||
echo [OK] "%CD%\%DIST%\mengyaping-backend"
|
||||
echo Next: copy this folder to server, then: docker compose build
|
||||
endlocal
|
||||
exit /b 0
|
||||
Reference in New Issue
Block a user