mirror of
https://github.com/actions/runner-images-sangeeth.git
synced 2025-12-20 06:29:50 +00:00
Update MongoDB and PostgreSQL documentation (#993)
* update mongodb and postgresql md * update pg service
This commit is contained in:
committed by
GitHub
parent
1810983a57
commit
52e3e704dd
@@ -1,35 +1,17 @@
|
||||
$PGUSER="postgres"
|
||||
function Validate-PostgreSQL {
|
||||
$pgready = Start-Process -FilePath pg_isready -Wait -PassThru
|
||||
$exitCode = $pgready.ExitCode
|
||||
if ($exitCode -eq 0)
|
||||
{
|
||||
Write-Host -Object "PostgreSQL has been successfully installed."
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host -Object "PostgreSQL is not ready. Exitcode: $exitCode"
|
||||
exit $exitCode
|
||||
}
|
||||
$pgReady = Start-Process -FilePath pg_isready -Wait -PassThru
|
||||
$exitCode = $pgReady.ExitCode
|
||||
|
||||
if ($exitCode -eq 0)
|
||||
{
|
||||
Write-Host -Object "PostgreSQL has been successfully installed."
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host -Object "PostgreSQL is not ready. Exitcode: $exitCode"
|
||||
exit $exitCode
|
||||
}
|
||||
|
||||
$paths = (Get-CimInstance Win32_Service -Filter "Name LIKE 'postgresql-%'").PathName
|
||||
$pgservice = (Get-CimInstance Win32_Service -Filter "Name LIKE 'postgresql-%'").Name
|
||||
$pgroot = $paths.split('"')[1].replace("\bin\pg_ctl.exe", "")
|
||||
$psqlVersion = pg_config --version | Out-String
|
||||
Validate-PostgreSQL
|
||||
|
||||
# Adding description of the software to Markdown
|
||||
$SoftwareName = "PostgreSQL"
|
||||
$Description = @"
|
||||
_Version:_ $psqlVersion<br/>
|
||||
_Default Path:_ $pgroot<br/>
|
||||
_User:_ $env:PGUSER<br/>
|
||||
_Password:_ $env:PGPASSWORD
|
||||
"@
|
||||
|
||||
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description
|
||||
|
||||
#Stop and disable PostgreSQL service
|
||||
Stop-Service -Name $pgservice
|
||||
Set-Service $pgservice -StartupType Disabled
|
||||
$pgService = Get-Service -Name postgresql*
|
||||
Stop-Service -InputObject $pgService
|
||||
Set-Service -InputObject $pgService -StartupType Disabled
|
||||
|
||||
Reference in New Issue
Block a user