mirror of
https://github.com/actions/runner-images.git
synced 2025-12-20 06:35:47 +00:00
[MacOS] Pin PostgreSQL version installed in the toolset (#4504)
This commit is contained in:
@@ -1,13 +1,16 @@
|
|||||||
#!/bin/bash -e -o pipefail
|
#!/bin/bash -e -o pipefail
|
||||||
source ~/utils/utils.sh
|
source ~/utils/utils.sh
|
||||||
|
|
||||||
#Install latest version of postgresql
|
# Fetch PostgreSQL version to install from the toolset
|
||||||
brew_smart_install "postgres"
|
toolsetVersion=$(get_toolset_value '.postgresql.version')
|
||||||
|
|
||||||
#Service postgresql should be started before use.
|
# Install latest version of PostgreSQL
|
||||||
|
brew_smart_install postgresql@$toolsetVersion
|
||||||
|
|
||||||
|
# Service PostgreSQL should be started before use
|
||||||
brew services start postgresql
|
brew services start postgresql
|
||||||
|
|
||||||
#Verify PostgreSQL is ready for accept incoming connections
|
# Verify PostgreSQL is ready for accept incoming connections
|
||||||
echo "Check PostgreSQL service is running"
|
echo "Check PostgreSQL service is running"
|
||||||
i=10
|
i=10
|
||||||
COMMAND='pg_isready'
|
COMMAND='pg_isready'
|
||||||
@@ -23,7 +26,7 @@ while [ $i -gt 0 ]; do
|
|||||||
sleep 10
|
sleep 10
|
||||||
done
|
done
|
||||||
|
|
||||||
#Stop postgresql
|
# Stop PostgreSQL
|
||||||
brew services stop postgresql
|
brew services stop postgresql
|
||||||
|
|
||||||
invoke_tests "Databases" "PostgreSQL"
|
invoke_tests "Databases" "PostgreSQL"
|
||||||
|
|||||||
@@ -9,11 +9,11 @@ Describe "MongoDB" {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Describe "PostgreSQL" {
|
Describe "PostgreSQL" {
|
||||||
It "PostgreSQL-Client" {
|
It "PostgreSQL version should correspond to the version in the toolset" {
|
||||||
"psql --version" | Should -ReturnZeroExitCode
|
$toolsetVersion = Get-ToolsetValue 'postgresql.version'
|
||||||
}
|
# Client version
|
||||||
|
(psql --version).split()[-1] | Should -BeLike "$toolsetVersion*"
|
||||||
It "PostgreSQL-Server" {
|
# Server version
|
||||||
"pg_config --version" | Should -ReturnZeroExitCode
|
(pg_config --version).split()[-1] | Should -BeLike "$toolsetVersion*"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -343,5 +343,8 @@
|
|||||||
},
|
},
|
||||||
"mongodb": {
|
"mongodb": {
|
||||||
"version": "5.0"
|
"version": "5.0"
|
||||||
|
},
|
||||||
|
"postgresql": {
|
||||||
|
"version": "14"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -295,5 +295,8 @@
|
|||||||
},
|
},
|
||||||
"mongodb": {
|
"mongodb": {
|
||||||
"version": "5.0"
|
"version": "5.0"
|
||||||
|
},
|
||||||
|
"postgresql": {
|
||||||
|
"version": "14"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -193,5 +193,8 @@
|
|||||||
},
|
},
|
||||||
"mongodb": {
|
"mongodb": {
|
||||||
"version": "5.0"
|
"version": "5.0"
|
||||||
|
},
|
||||||
|
"postgresql": {
|
||||||
|
"version": "14"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user