Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
| ... | ... |
@@ -262,29 +262,16 @@ RUN ` |
| 262 | 262 |
RUN ` |
| 263 | 263 |
Function Build-GoTestSum() { `
|
| 264 | 264 |
Write-Host "INFO: Building gotestsum version $Env:GOTESTSUM_COMMIT in $Env:GOPATH"; ` |
| 265 |
- $optsForGet = @('"get"', '"-d"', '"gotest.tools/gotestsum"'); `
|
|
| 266 |
- &go $optsForGet; ` |
|
| 267 |
- $savedExitCode = $LASTEXITCODE; ` |
|
| 268 |
- if ($savedExitCode -ne 0) { `
|
|
| 265 |
+ $env:GO111MODULE = 'on'; ` |
|
| 266 |
+ &go get -d "gotest.tools/gotestsum@${Env:GOTESTSUM_COMMIT}"; `
|
|
| 267 |
+ $env:GO111MODULE = 'off'; ` |
|
| 268 |
+ if ($LASTEXITCODE -ne 0) { `
|
|
| 269 | 269 |
Throw '"Failed getting gotestsum sources..."' ` |
| 270 | 270 |
}; ` |
| 271 |
- Write-Host "INFO: Sources obtained for gotestsum..."; ` |
|
| 272 |
- $GotestsumPath=Join-Path -Path $Env:GOPATH -ChildPath "src\gotest.tools\gotestsum"; ` |
|
| 273 |
- Push-Location $GotestsumPath; ` |
|
| 274 |
- $optsForCheckout = @('"checkout"', '"-q"', """$Env:GOTESTSUM_COMMIT"""); `
|
|
| 275 |
- &git $optsForCheckout; ` |
|
| 276 |
- $savedExitCode = $LASTEXITCODE; ` |
|
| 277 |
- if ($savedExitCode -eq 0) { `
|
|
| 278 |
- Write-Host "INFO: Checkout done for gotestsum..."; ` |
|
| 279 |
- $optsForBuild = @('"build"', '"-buildmode=exe"'); `
|
|
| 280 |
- &go $optsForBuild; ` |
|
| 281 |
- $savedExitCode = $LASTEXITCODE; ` |
|
| 282 |
- } else { `
|
|
| 283 |
- Throw '"gotestsum checkout failed..."'; ` |
|
| 284 |
- } ` |
|
| 285 |
- Pop-Location; ` |
|
| 286 |
- ` |
|
| 287 |
- if ($savedExitCode -ne 0) { `
|
|
| 271 |
+ $env:GO111MODULE = 'on'; ` |
|
| 272 |
+ &go build -buildmode=exe -o "${Env:GOPATH}\bin\gotestsum.exe" gotest.tools/gotestsum; `
|
|
| 273 |
+ $env:GO111MODULE = 'off'; ` |
|
| 274 |
+ if ($LASTEXITCODE -ne 0) { `
|
|
| 288 | 275 |
Throw '"gotestsum build failed..."'; ` |
| 289 | 276 |
} ` |
| 290 | 277 |
Write-Host "INFO: Build done for gotestsum..."; ` |
| ... | ... |
@@ -528,11 +528,7 @@ Try {
|
| 528 | 528 |
Throw "ERROR: Failed to docker cp the daemon binary (dockerd.exe) to $env:TEMP\binary" |
| 529 | 529 |
} |
| 530 | 530 |
|
| 531 |
- $GotestsumBinRelLocationInContainer="src\gotest.tools\gotestsum\gotestsum.exe" |
|
| 532 |
- if (-not($LastExitCode -eq 0)) {
|
|
| 533 |
- Throw "ERROR: Failed to docker cp the gotestsum binary (gotestsum.exe) to $env:TEMP\binary" |
|
| 534 |
- } |
|
| 535 |
- docker cp "$COMMITHASH`:c`:\gopath\$GotestsumBinRelLocationInContainer" $env:TEMP\binary\ |
|
| 531 |
+ docker cp "$COMMITHASH`:c`:\gopath\bin\gotestsum.exe" $env:TEMP\binary\ |
|
| 536 | 532 |
if (-not (Test-Path "$env:TEMP\binary\gotestsum.exe")) {
|
| 537 | 533 |
Throw "ERROR: gotestsum.exe not found...." ` |
| 538 | 534 |
} |
| ... | ... |
@@ -94,7 +94,7 @@ param( |
| 94 | 94 |
$ErrorActionPreference = "Stop" |
| 95 | 95 |
$ProgressPreference = "SilentlyContinue" |
| 96 | 96 |
$pushed=$False # To restore the directory if we have temporarily pushed to one. |
| 97 |
-Set-Variable GOTESTSUM_LOCATION -option Constant -value "$env:GOPATH/src/gotest.tools/gotestsum" |
|
| 97 |
+Set-Variable GOTESTSUM_LOCATION -option Constant -value "$env:GOPATH/bin/" |
|
| 98 | 98 |
|
| 99 | 99 |
# Utility function to get the commit ID of the repository |
| 100 | 100 |
Function Get-GitCommit() {
|