Revision 2f12ea893b5dbecbe0f9bd5bb527b48e00d91e06 authored by Xiang Li on 10 March 2016, 05:37:10 UTC, committed by Xiang Li on 10 March 2016, 06:29:21 UTC
1 parent a243f80
build.bat
@echo off
SET ORG_PATH=github.com\coreos
SET REPO_PATH=%ORG_PATH%\etcd
SET GOPATH=%cd%\gopath
:: Cleanup old builds
IF EXIST "%GOPATH%\src\%REPO_PATH%" rmdir /s /q "%GOPATH%\src\%REPO_PATH%"
IF EXIST "%GOPATH%\src\%ORG_PATH%" rmdir /s /q "%GOPATH%\src\%ORG_PATH%"
IF EXIST "%cd%\bin" rmdir /s /q "%cd%\bin"
md "%GOPATH%\src\%ORG_PATH%"
mklink /d "%GOPATH%\src\%REPO_PATH%" "%cd%"
FOR /f "usebackq tokens=*" %%a IN (`go env`) DO %%a
(FOR /f "tokens=*" %%i IN ('git rev-parse --short HEAD') DO SET GIT_SHA=%%i) 2>NUL
IF NOT DEFINED GIT_SHA SET GIT_SHA=GitNotFound
:: Static compilation is useful when etcd is run in a container
SET CGO_ENABLED=0
go build -a -installsuffix cgo -ldflags "-s -X %REPO_PATH%\version.GitSHA %GIT_SHA%" -o bin\etcd.exe "%REPO_PATH%"
:: TODO: Get the %GIT_SHA% argument to work. Useful for `etcd --version` style commands.
go build -a -installsuffix cgo -ldflags "-s" -o bin\etcdctl.exe "%REPO_PATH%\etcdctl"
![swh spinner](/static/img/swh-spinner.gif)
Computing file changes ...