Fixed the printing message.
@@ -204,24 +204,27 @@ function DockerValidation{
[string]$workingDirectory
)
if ($PackageSourceOverride) {
- docker run -v "${workingDirectory}:/workdir/out" -e TARGET_PACKAGE=$packageName -e TARGET_VERSION=$packageVersion `
- -e EXTRA_INDEX_URL=$PackageSourceOverride -t $DocValidationImageId 2>&1 | Out-Null
+ Write-Host "docker run -v ${workingDirectory}:/workdir/out -e TARGET_PACKAGE=$packageName -e TARGET_VERSION=$packageVersion -e EXTRA_INDEX_URL=$PackageSourceOverride -t $DocValidationImageId"
+ $commandLine = docker run -v "${workingDirectory}:/workdir/out" -e TARGET_PACKAGE=$packageName -e TARGET_VERSION=$packageVersion `
+ -e EXTRA_INDEX_URL=$PackageSourceOverride -t $DocValidationImageId 2>&1
}
else {
- docker run -v "${workingDirectory}:/workdir/out" `
- -e TARGET_PACKAGE=$packageName -e TARGET_VERSION=$packageVersion -t $DocValidationImageId 2>&1 | Out-Null
+ Write-Host "docker run -v ${workingDirectory}:/workdir/out -e TARGET_PACKAGE=$packageName -e TARGET_VERSION=$packageVersion -t $DocValidationImageId"
+ $commandLine = docker run -v "${workingDirectory}:/workdir/out" `
+ -e TARGET_PACKAGE=$packageName -e TARGET_VERSION=$packageVersion -t $DocValidationImageId 2>&1
}
# The docker exit codes: https://docs.docker.com/engine/reference/run/#exit-status
# If the docker failed because of docker itself instead of the application,
# we should skip the validation and keep the packages.
+
if ($LASTEXITCODE -eq 125 -Or $LASTEXITCODE -eq 126 -Or $LASTEXITCODE -eq 127) {
- Write-Host $commandLine
+ $commandLine | ForEach-Object { Write-Debug $_ }
LogWarning "The `docker` command does not work with exit code $LASTEXITCODE. Fall back to npm install $packageName directly."
FallbackValidation -packageName "$packageName" -packageVersion "$packageVersion" -workingDirectory $workingDirectory -PackageSourceOverride $PackageSourceOverride
}
elseif ($LASTEXITCODE -ne 0) {
- Write-Host $commandLine
- LogWarning "Package $($Package.name) ref docs validation failed."
+ $commandLine | ForEach-Object { Write-Debug $_ }
+ LogWarning "Package $packageName ref docs validation failed."
return $false
}
return $true
