Files
soci/scripts/ci/before_build_postgresql.sh
Vadim Zeitlin fb04446e35 Convert most HTTP links to HTTPS
No real changes, but it's not very serious to use HTTP links in 2025.
2025-03-04 18:03:53 +01:00

31 lines
742 B
Bash
Executable File

#!/usr/bin/env bash
# Sets up environment for SOCI backend PostgreSQL in CI builds
#
# Mateusz Loskot <mateusz@loskot.net>, https://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