[windows] Pin PostgreSQL and Update LLVM (#10014)

* [windows] Pin PostgreSQL version

* Fix if statement

* Fix PostgreSQL pester test

* Update LLVM to 18*
This commit is contained in:
Shamil Mubarakshin
2024-06-08 11:02:11 +02:00
committed by GitHub
parent 7271f004d4
commit 870d08d9cb
4 changed files with 49 additions and 41 deletions

View File

@@ -11,8 +11,14 @@ $pgPwd = "root"
[Environment]::SetEnvironmentVariable("PGUSER", $pgUser, "Machine") [Environment]::SetEnvironmentVariable("PGUSER", $pgUser, "Machine")
[Environment]::SetEnvironmentVariable("PGPASSWORD", $pgPwd, "Machine") [Environment]::SetEnvironmentVariable("PGPASSWORD", $pgPwd, "Machine")
# Define latest available version to install based on version specified in the toolset
$toolsetVersion = (Get-ToolsetContent).postgresql.version $toolsetVersion = (Get-ToolsetContent).postgresql.version
if ($null -ne ($toolsetVersion | Select-String -Pattern '\d+\.\d+\.\d+')) {
$majorVersion = ([version]$toolsetVersion).Major
$minorVersion = ([version]$toolsetVersion).Minor
$patchVersion = ([version]$toolsetVersion).Build
$installerUrl = "https://get.enterprisedb.com/postgresql/postgresql-$majorVersion.$minorVersion-$patchVersion-windows-x64.exe"
} else {
# Define latest available version to install based on version specified in the toolset
$getPostgreReleases = Invoke-WebRequest -Uri "https://git.postgresql.org/gitweb/?p=postgresql.git;a=tags" -UseBasicParsing $getPostgreReleases = Invoke-WebRequest -Uri "https://git.postgresql.org/gitweb/?p=postgresql.git;a=tags" -UseBasicParsing
# Getting all links matched to the pattern (e.g.a=log;h=refs/tags/REL_14) # Getting all links matched to the pattern (e.g.a=log;h=refs/tags/REL_14)
$targetReleases = $getPostgreReleases.Links.href | Where-Object { $_ -match "a=log;h=refs/tags/REL_$toolsetVersion" } $targetReleases = $getPostgreReleases.Links.href | Where-Object { $_ -match "a=log;h=refs/tags/REL_$toolsetVersion" }
@@ -28,10 +34,11 @@ foreach ($release in $targetReleases) {
# Sorting and getting the last one # Sorting and getting the last one
$targetMinorVersions = ($minorVersions | Sort-Object)[-1] $targetMinorVersions = ($minorVersions | Sort-Object)[-1]
# Install latest PostgreSQL
# In order to get rid of error messages (we know we will have them), force ErrorAction to SilentlyContinue # In order to get rid of error messages (we know we will have them), force ErrorAction to SilentlyContinue
$errorActionOldValue = $ErrorActionPreference $errorActionOldValue = $ErrorActionPreference
$ErrorActionPreference = 'SilentlyContinue' $ErrorActionPreference = 'SilentlyContinue'
# Install latest PostgreSQL
# Starting from number 9 and going down, check if the installer is available. If yes, break the loop. # Starting from number 9 and going down, check if the installer is available. If yes, break the loop.
# If an installer with $targetMinorVersions is not to be found, the $targetMinorVersions will be decreased by 1 # If an installer with $targetMinorVersions is not to be found, the $targetMinorVersions will be decreased by 1
$increment = 9 $increment = 9
@@ -49,6 +56,7 @@ do {
$increment-- $increment--
} }
} while (!$response) } while (!$response)
}
# 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

View File

@@ -72,8 +72,8 @@ Describe "PostgreSQL" {
} }
Context "PostgreSQL version" { Context "PostgreSQL version" {
It "PostgreSQL version should correspond to the version in the toolset" { It "PostgreSQL version should correspond to the Major version in the toolset" {
$toolsetVersion = (Get-ToolsetContent).postgresql.version $toolsetVersion = (Get-ToolsetContent).postgresql.version.Split(".")[0]
# Client version # Client version
(& $env:PGBIN\psql --version).split()[-1] | Should -BeLike "$toolsetVersion*" (& $env:PGBIN\psql --version).split()[-1] | Should -BeLike "$toolsetVersion*"
# Server version # Server version

View File

@@ -469,10 +469,10 @@
"version": "8.3" "version": "8.3"
}, },
"llvm": { "llvm": {
"version": "16" "version": "18"
}, },
"postgresql": { "postgresql": {
"version": "14", "version": "14.12.1",
"signature": "698BA51AA27CC31282AACA5055E4B9190BC6C0E9" "signature": "698BA51AA27CC31282AACA5055E4B9190BC6C0E9"
}, },
"kotlin": { "kotlin": {

View File

@@ -367,13 +367,13 @@
"version": "3.10" "version": "3.10"
}, },
"llvm": { "llvm": {
"version": "16" "version": "18"
}, },
"php": { "php": {
"version": "8.3" "version": "8.3"
}, },
"postgresql": { "postgresql": {
"version": "14", "version": "14.12.1",
"signature": "698BA51AA27CC31282AACA5055E4B9190BC6C0E9" "signature": "698BA51AA27CC31282AACA5055E4B9190BC6C0E9"
}, },
"kotlin": { "kotlin": {