forked from taskcluster/taskcluster
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.cmd
27 lines (22 loc) · 970 Bytes
/
build.cmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
:: main script to build and test generic worker on windows
@echo on
:: cd to dir containing this script
pushd %~dp0
go get github.com/taskcluster/livelog github.com/gordonklaus/ineffassign || exit /b %ERRORLEVEL%
cd gw-codegen
go install -v || exit /b %ERRORLEVEL%
cd ..
go generate || exit /b %ERRORLEVEL%
go install -v ./... || exit /b %ERRORLEVEL%
:: this counts the number of lines returned by git status
:: dump temp file a directory higher, otherwise git status reports the tmp1.txt file!
git status --porcelain | C:\Windows\System32\find.exe /v /c "" > ..\tmp1.txt
set /P lines=<..\tmp1.txt
:: this checks that if more than 0 lines are returned, we fail
if %lines% gtr 0 exit /b 64
git rev-parse HEAD > revision.txt
set /p REVISION=< revision.txt
del revision.txt
set GORACE=history_size=7
go test -ldflags "-X github.com/taskcluster/taskcluster/workers/generic-worker.revision=%REVISION%" ./... || exit /b %ERRORLEVEL%
ineffassign . || exit /b %ERRORLEVEL%