Prechádzať zdrojové kódy

Dockerfile.windows: fix gotestsum.installer installing wrong version

When using go modules, `go build` will always fetch the latest
version of the package, so ignores the version we previously `go get`'d.

Instead of running `go get` and `go build` separately, this patch uses
`go get` (without the `-d` option) to do it all in one step.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Sebastiaan van Stijn 5 rokov pred
rodič
commit
20570d91c8
1 zmenil súbory, kde vykonal 6 pridanie a 9 odobranie
  1. 6 9
      Dockerfile.windows

+ 6 - 9
Dockerfile.windows

@@ -262,15 +262,12 @@ RUN `
 RUN `
   Function Build-GoTestSum() { `
     Write-Host "INFO: Building gotestsum version $Env:GOTESTSUM_COMMIT in $Env:GOPATH"; `
-    $env:GO111MODULE = 'on'; `
-    &go get -d "gotest.tools/gotestsum@${Env:GOTESTSUM_COMMIT}"; `
-    $env:GO111MODULE = 'off'; `
-    if ($LASTEXITCODE -ne 0) {  `
-      Throw '"Failed getting gotestsum sources..."'  `
-    }; `
-    $env:GO111MODULE = 'on'; `
-    &go build -buildmode=exe -o "${Env:GOPATH}\bin\gotestsum.exe" gotest.tools/gotestsum; `
-    $env:GO111MODULE = 'off'; `
+    $Env:GO111MODULE = 'on'; `
+    $tmpGobin = "${Env:GOBIN_TMP}"; `
+    $Env:GOBIN = """${Env:GOPATH}`\bin"""; `
+    &go get -buildmode=exe "gotest.tools/gotestsum@${Env:GOTESTSUM_COMMIT}"; `
+    $Env:GOBIN = "${tmpGobin}"; `
+    $Env:GO111MODULE = 'off'; `
     if ($LASTEXITCODE -ne 0) {  `
       Throw '"gotestsum build failed..."'; `
     } `