Files
runner-images/images/macos/provision/core/postgresql.sh
Darii Nurgaleev 0a255311b1 [macOS] Pester tests invocation after install. (#2421)
* [macOS] Fail Pester tests on error

* return it back

* [macOS] Pester tests invokation after install

* fix nitpicks

* CocoaPods fix
2021-01-13 20:46:44 +03:00

30 lines
764 B
Bash

#!/bin/bash -e -o pipefail
source ~/utils/utils.sh
source ~/utils/invoke-tests.sh
#Install latest version of postgresql
brew_smart_install "postgres"
#Service postgresql should be started before use.
brew services start postgresql
#Verify PostgreSQL is ready for accept incoming connections
echo "Check PostgreSQL service is running"
i=10
COMMAND='pg_isready'
while [ $i -gt 0 ]; do
echo "Check PostgreSQL service status"
eval $COMMAND && break
((i--))
if [ $i == 0 ]; then
echo "PostgreSQL service not ready, all attempts exhausted"
exit 1
fi
echo "PostgreSQL service not ready, wait 10 more sec, attempts left: $i"
sleep 10
done
#Stop postgresql
brew services stop postgresql
invoke_tests "Databases" "PostgreSQL"