Files
InfoGenie/infogenie-backend-go/build-linux-amd64.bat

22 lines
570 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 EnableExtensions
cd /d "%~dp0"
REM 一键交叉编译 Linux amd64供 Dockerfile.prebuilt 直接 COPY dist\server服务器上无需再 go build
if not exist "dist" mkdir "dist"
set "CGO_ENABLED=0"
set "GOOS=linux"
set "GOARCH=amd64"
set "GOTOOLCHAIN=auto"
echo [build-linux-amd64] GOOS=%GOOS% GOARCH=%GOARCH% GOTOOLCHAIN=%GOTOOLCHAIN%
go build -trimpath -ldflags="-s -w" -o "dist\server" .\cmd\server
if errorlevel 1 (
echo [build-linux-amd64] FAILED
exit /b 1
)
echo [build-linux-amd64] OK: dist\server
exit /b 0