mirror of
https://github.com/actions/runner-images.git
synced 2025-12-19 08:22:12 +00:00
debugging
This commit is contained in:
@@ -70,10 +70,46 @@ if ((Get-ToolsetContent).postgresql.installVcRedist) {
|
|||||||
# Return the previous value of ErrorAction and invoke Install-Binary function
|
# Return the previous value of ErrorAction and invoke Install-Binary function
|
||||||
$ErrorActionPreference = $errorActionOldValue
|
$ErrorActionPreference = $errorActionOldValue
|
||||||
$installerArgs = @("--install_runtimes 0", "--superpassword root", "--enable_acledit 1", "--unattendedmodeui none", "--mode unattended")
|
$installerArgs = @("--install_runtimes 0", "--superpassword root", "--enable_acledit 1", "--unattendedmodeui none", "--mode unattended")
|
||||||
|
try {
|
||||||
Install-Binary `
|
Install-Binary `
|
||||||
-Url $installerUrl `
|
-Url $installerUrl `
|
||||||
-InstallArgs $installerArgs `
|
-InstallArgs $installerArgs `
|
||||||
-ExpectedSignature (Get-ToolsetContent).postgresql.signature
|
-ExpectedSignature (Get-ToolsetContent).postgresql.signature
|
||||||
|
} catch {
|
||||||
|
# Recursively search for install-postgres.log
|
||||||
|
$installPostgresLog = Get-ChildItem -Path $env:TEMP -Recurse -Filter "install-postgresql.log" -ErrorAction SilentlyContinue | Select-Object -First 1
|
||||||
|
|
||||||
|
if ($installPostgresLog) {
|
||||||
|
Write-Output "install-postgres.log found at: $($installPostgresLog.FullName)"
|
||||||
|
Write-Output "Content of install-postgres.log:"
|
||||||
|
Get-Content -Path $installPostgresLog.FullName | ForEach-Object { Write-Output $_ }
|
||||||
|
} else {
|
||||||
|
Write-Output "install-postgres.log not found."
|
||||||
|
|
||||||
|
# Recursively search for bitrock_installer.log or bitrock_installer_*.log
|
||||||
|
$bitrockInstallerLogs = @(
|
||||||
|
Get-ChildItem -Path $tempPath -Recurse -Filter "bitrock_installer.log" -ErrorAction SilentlyContinue,
|
||||||
|
Get-ChildItem -Path $tempPath -Recurse -Filter "bitrock_installer_*.log" -ErrorAction SilentlyContinue
|
||||||
|
)
|
||||||
|
|
||||||
|
# Flatten the array to remove nested arrays
|
||||||
|
$bitrockInstallerLogs = $bitrockInstallerLogs | Where-Object { $_ }
|
||||||
|
|
||||||
|
foreach ($log in $bitrockInstallerLogs) {
|
||||||
|
if ($log) {
|
||||||
|
Write-Output "Found log file: $($log.FullName)"
|
||||||
|
Write-Output "Content of bitrock_install*.log:"
|
||||||
|
Get-Content -Path $log.FullName | ForEach-Object { Write-Output $_ }
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# If no log files were found
|
||||||
|
if (-not $log) {
|
||||||
|
Write-Warning "No relevant log files found in the temporary directory."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
# Get Path to pg_ctl.exe
|
# Get Path to pg_ctl.exe
|
||||||
$pgPath = (Get-CimInstance Win32_Service -Filter "Name LIKE 'postgresql-%'").PathName
|
$pgPath = (Get-CimInstance Win32_Service -Filter "Name LIKE 'postgresql-%'").PathName
|
||||||
|
|||||||
Reference in New Issue
Block a user