summaryrefslogtreecommitdiff
path: root/Dockerfile.windows
diff options
context:
space:
mode:
authorSebastiaan van Stijn <github@gone.nl>2020-05-16 18:41:46 +0200
committerSebastiaan van Stijn <github@gone.nl>2020-05-16 20:12:39 +0200
commitaadc55c605540c49b030c4dd1b8de73a944abfc1 (patch)
tree436d762bab92f8887fdb5b3f9e09567f4a85439a /Dockerfile.windows
parent1d9da1b233314ed487093987293ed0057c919c6d (diff)
downloaddocker-aadc55c605540c49b030c4dd1b8de73a944abfc1.tar.gz
Dockerfile.windows: fix build of gotestsum
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Diffstat (limited to 'Dockerfile.windows')
-rw-r--r--Dockerfile.windows29
1 files changed, 8 insertions, 21 deletions
diff --git a/Dockerfile.windows b/Dockerfile.windows
index 412138d1ee..a0dde55962 100644
--- a/Dockerfile.windows
+++ b/Dockerfile.windows
@@ -262,29 +262,16 @@ RUN `
RUN `
Function Build-GoTestSum() { `
Write-Host "INFO: Building gotestsum version $Env:GOTESTSUM_COMMIT in $Env:GOPATH"; `
- $optsForGet = @('"get"', '"-d"', '"gotest.tools/gotestsum"'); `
- &go $optsForGet; `
- $savedExitCode = $LASTEXITCODE; `
- if ($savedExitCode -ne 0) { `
+ $env:GO111MODULE = 'on'; `
+ &go get -d "gotest.tools/gotestsum@${Env:GOTESTSUM_COMMIT}"; `
+ $env:GO111MODULE = 'off'; `
+ if ($LASTEXITCODE -ne 0) { `
Throw '"Failed getting gotestsum sources..."' `
}; `
- Write-Host "INFO: Sources obtained for gotestsum..."; `
- $GotestsumPath=Join-Path -Path $Env:GOPATH -ChildPath "src\gotest.tools\gotestsum"; `
- Push-Location $GotestsumPath; `
- $optsForCheckout = @('"checkout"', '"-q"', """$Env:GOTESTSUM_COMMIT"""); `
- &git $optsForCheckout; `
- $savedExitCode = $LASTEXITCODE; `
- if ($savedExitCode -eq 0) { `
- Write-Host "INFO: Checkout done for gotestsum..."; `
- $optsForBuild = @('"build"', '"-buildmode=exe"'); `
- &go $optsForBuild; `
- $savedExitCode = $LASTEXITCODE; `
- } else { `
- Throw '"gotestsum checkout failed..."'; `
- } `
- Pop-Location; `
- `
- if ($savedExitCode -ne 0) { `
+ $env:GO111MODULE = 'on'; `
+ &go build -buildmode=exe -o "${Env:GOPATH}\bin\gotestsum.exe" gotest.tools/gotestsum; `
+ $env:GO111MODULE = 'off'; `
+ if ($LASTEXITCODE -ne 0) { `
Throw '"gotestsum build failed..."'; `
} `
Write-Host "INFO: Build done for gotestsum..."; `