소스 검색

Merge pull request #41151 from thaJeztah/fix_gotestsum_install_again

Brian Goff 5 년 전
부모
커밋
a70842f9c8
2개의 변경된 파일7개의 추가작업 그리고 12개의 파일을 삭제
  1. 6 9
      Dockerfile.windows
  2. 1 3
      hack/dockerfile/install/gotestsum.installer

+ 6 - 9
Dockerfile.windows

@@ -262,15 +262,12 @@ RUN `
 RUN `
 RUN `
   Function Build-GoTestSum() { `
   Function Build-GoTestSum() { `
     Write-Host "INFO: Building gotestsum version $Env:GOTESTSUM_COMMIT in $Env:GOPATH"; `
     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) {  `
     if ($LASTEXITCODE -ne 0) {  `
       Throw '"gotestsum build failed..."'; `
       Throw '"gotestsum build failed..."'; `
     } `
     } `

+ 1 - 3
hack/dockerfile/install/gotestsum.installer

@@ -5,7 +5,5 @@
 install_gotestsum() (
 install_gotestsum() (
 	set -e
 	set -e
 	export GO111MODULE=on
 	export GO111MODULE=on
-	go get -d "gotest.tools/gotestsum@${GOTESTSUM_COMMIT}"
-	go build ${GO_BUILDMODE} -o "${PREFIX}/gotestsum" 'gotest.tools/gotestsum'
-
+	GOBIN="${PREFIX}" go get "gotest.tools/gotestsum@${GOTESTSUM_COMMIT}"
 )
 )