1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Merge pull request #39854 from thaJeztah/hack_windows_explicit_exit

hack/ci/windows.ps1: explicitly set exit code to result of tests
This commit is contained in:
Brian Goff 2019-09-12 11:34:44 -07:00 committed by GitHub
commit 4b55f3cf8b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -15,6 +15,11 @@ if ($env:BUILD_TAG -match "-LoW") { $env:LCOW_MODE=1 }
if ($env:BUILD_TAG -match "-WoW") { $env:LCOW_MODE="" } if ($env:BUILD_TAG -match "-WoW") { $env:LCOW_MODE="" }
Write-Host -ForegroundColor Red "DEBUG: print all environment variables to check how Jenkins runs this script"
$allArgs = [Environment]::GetCommandLineArgs()
Write-Host -ForegroundColor Red $allArgs
Write-Host -ForegroundColor Red "----------------------------------------------------------------------------"
# ------------------------------------------------------------------------------------------- # -------------------------------------------------------------------------------------------
# When executed, we rely on four variables being set in the environment: # When executed, we rely on four variables being set in the environment:
# #
@ -979,6 +984,9 @@ Catch [Exception] {
Throw $_ Throw $_
} }
Finally { Finally {
# Preserve the LastExitCode of the tests
$tmpLastExitCode = $LastExitCode
$ErrorActionPreference="SilentlyContinue" $ErrorActionPreference="SilentlyContinue"
$global:ProgressPreference=$origProgressPreference $global:ProgressPreference=$origProgressPreference
Write-Host -ForegroundColor Green "INFO: Tidying up at end of run" Write-Host -ForegroundColor Green "INFO: Tidying up at end of run"
@ -1016,4 +1024,6 @@ Finally {
$Dur=New-TimeSpan -Start $StartTime -End $(Get-Date) $Dur=New-TimeSpan -Start $StartTime -End $(Get-Date)
Write-Host -ForegroundColor $FinallyColour "`nINFO: executeCI.ps1 exiting at $(date). Duration $dur`n" Write-Host -ForegroundColor $FinallyColour "`nINFO: executeCI.ps1 exiting at $(date). Duration $dur`n"
exit $tmpLastExitCode
} }