You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

24 lines
528 B

@echo off
@title build so app
@REM build.bat gateway_ws 1.0.0
set APP=%1
set DOCKER_IMAGE_VERSION=%2
set GO111MODULE=on
set CGO_ENABLED=0
set GOOS=linux
set GOARCH=amd64
go build -o target/%APP%/%APP% cmd/%APP%/main.go
if exist cmd\%APP%\config.toml (
if not exist target\%APP%\config (
md target\%APP%\config
)
copy cmd\%APP%\config.toml target\%APP%\config\
)
if not "%DOCKER_IMAGE_VERSION%"=="" (
docker build -t so-%APP%:%DOCKER_IMAGE_VERSION% --build-arg APP=%APP% .
)
echo %APP% build finished