'init'
This commit is contained in:
34
sc-lktx-backend/build.bat
Normal file
34
sc-lktx-backend/build.bat
Normal file
@@ -0,0 +1,34 @@
|
||||
@echo off
|
||||
chcp 65001 >nul
|
||||
|
||||
setlocal enabledelayedexpansion
|
||||
|
||||
set OUTPUT=server
|
||||
set BIN_DIR=bin
|
||||
|
||||
echo === Build Go backend (Linux amd64) ===
|
||||
|
||||
set GOOS=linux
|
||||
set GOARCH=amd64
|
||||
set CGO_ENABLED=0
|
||||
|
||||
go build -ldflags="-s -w" -o "%BIN_DIR%/%OUTPUT%" ./cmd/server/
|
||||
|
||||
if errorlevel 1 (
|
||||
echo Build failed, error code: %errorlevel%
|
||||
exit /b %errorlevel%
|
||||
)
|
||||
|
||||
echo === Build complete ===
|
||||
echo Output: %BIN_DIR%/%OUTPUT%
|
||||
|
||||
if exist config\config-prod.yaml (
|
||||
copy config\config-prod.yaml "%BIN_DIR%\" >nul
|
||||
) else (
|
||||
echo Warning: config-prod.yaml not found
|
||||
)
|
||||
|
||||
echo === Deploy files ===
|
||||
dir "%BIN_DIR%"
|
||||
|
||||
endlocal
|
||||
Reference in New Issue
Block a user