Files
SeeyonFileSystem/server/deploy.bat

51 lines
1.0 KiB
Batchfile
Raw Normal View History

2026-07-18 10:52:32 +08:00
@echo off
setlocal
echo ============================================
echo Build Backend
echo ============================================
set "DEPLOY_DIR=%~dp0deploy"
if not exist "%DEPLOY_DIR%" mkdir "%DEPLOY_DIR%"
:: Windows exe
echo.
echo [1/2] Building Windows amd64...
set CGO_ENABLED=0
set GOOS=windows
set GOARCH=amd64
go build -ldflags "-s -w" -o "%DEPLOY_DIR%\server.exe" main.go
if %errorlevel% neq 0 (
echo Windows build FAILED
pause
exit /b 1
)
echo OK: server.exe
:: Linux binary
echo.
echo [2/2] Building Linux amd64...
2026-07-10 17:33:33 +08:00
set CGO_ENABLED=0
set GOOS=linux
set GOARCH=amd64
2026-07-18 10:52:32 +08:00
go build -ldflags "-s -w" -o "%DEPLOY_DIR%\server" main.go
if %errorlevel% neq 0 (
echo Linux build FAILED
pause
exit /b 1
)
echo OK: server
:: Copy config
copy /y config.yaml "%DEPLOY_DIR%\config.yaml.example" >/dev/null
echo.
echo ============================================
echo Build Complete!
echo ============================================
echo.
echo Output directory:
echo %DEPLOY_DIR%
echo.
pause