azure-sdk-for-cpp/eng/scripts/Show-FailureLogs.ps1
Daniel Jurek ce4f25da23
Upload logs on cmake generate/build failure (#5293)
* Upload logs on cmake generate/build failure

* Copy relevant files to staging location, clean up after publishing

* Update cspell words

* Test: break cmake generate in a way that'll produce SOME log files.

* Revert "Test: break cmake generate in a way that'll produce SOME log files."

This reverts commit d5a300587b3359ed3f2bf7be5abea40868f958a7.

* Show failure logs instead of uploading artifacts. Only show log files for vcpkg at this time

* Reapply "Test: break cmake generate in a way that'll produce SOME log files."

This reverts commit 582629ad587f3c9b652ac1f8a7eda5e12d46843a.

* Revert "Reapply "Test: break cmake generate in a way that'll produce SOME log files.""

This reverts commit 7a35250c7e598fc6e1c060f896cbc952704e40bf.

* Another type of test

* Revert inadvertent whitespace changes

* Revert "Another type of test"

This reverts commit e38013f95b152e4e2a3b9d27ccf1eb9b63fa1817.

* More logging
2024-02-07 06:36:36 +00:00

25 lines
1.1 KiB
PowerShell

# Only show contents of particular vcpkg log files whose potentially sensitive
# information will be redacted by DevOps (if it's included).
# Before adding other expressions to output ensure that those logs will not
# contain sensitive information or that DevOps is properly configured to remove
# sensitive information.
$logFiles = Get-ChildItem -Recurse -Filter *.log
$filteredLogs = $logFiles.Where({ $_.Name -in ('vcpkg-bootstrap.log', 'vcpkg-manifest-install.log') })
if (!$filteredLogs) {
Write-Host "No logs found"
exit 0
}
foreach ($logFile in $filteredLogs)
{
Write-Host "//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////"
Write-Host "=============================================================================================================================="
Write-Host "Log file: $logFile"
Write-Host "=============================================================================================================================="
Get-Content $logFile | Write-Host
}
exit 0