mirror of
https://github.com/SOCI/soci.git
synced 2026-05-20 03:58:52 -05:00
698495c33b
It used to be part of macos-12 image but is not present in the later ones for whatever reason. Installing postgresql formula using brew already initializes the database cluster but does it in a non-default directory, so adjust PGDATA definition accordingly and remove "pg_ctl init" which is not needed any longer.
31 lines
741 B
Bash
Executable File
31 lines
741 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# Sets up environment for SOCI backend PostgreSQL in CI builds
|
|
#
|
|
# Mateusz Loskot <mateusz@loskot.net>, http://github.com/SOCI
|
|
#
|
|
source ${SOCI_SOURCE_DIR}/scripts/ci/common.sh
|
|
|
|
case "$(uname)" in
|
|
Linux)
|
|
sudo service postgresql start
|
|
pg_isready --timeout=60
|
|
sudo -u postgres psql -c "ALTER USER postgres PASSWORD 'Password12!';"
|
|
;;
|
|
|
|
Darwin)
|
|
pg_ctl start
|
|
pg_isready --timeout=60
|
|
createuser --superuser postgres
|
|
;;
|
|
|
|
*)
|
|
echo 'Unknown OS, PostgreSQL not available'
|
|
exit 1
|
|
esac
|
|
|
|
psql --version
|
|
psql -c 'create database soci_test;' -U postgres
|
|
|
|
echo 'Testing connection to the database:'
|
|
psql -c 'select user;' -U postgres -d soci_test
|