Files
runner-images/images/linux/scripts/installers/postgresql.sh
T

28 lines
898 B
Bash
Raw Normal View History

2020-10-07 13:49:40 +05:00
#!/bin/bash -e
2020-01-31 12:21:33 +03:00
################################################################################
## File: postgresql.sh
## Desc: Installs Postgresql
################################################################################
#Preparing repo for PostgreSQL 12.
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -
echo "deb http://apt.postgresql.org/pub/repos/apt/ `lsb_release -cs`-pgdg main" | tee /etc/apt/sources.list.d/pgdg.list
echo "Install PostgreSQL"
apt update
apt install postgresql postgresql-client
2020-01-31 12:21:33 +03:00
echo "Install libpq-dev"
apt-get install libpq-dev
#Verify that PostgreSQL is ready for accept incoming connections.
# exit codes:
# ready - 0
# reject - 1
# connection timeout - 2
pg_isready
# Disable postgresql.service
systemctl is-active --quiet postgresql.service && systemctl stop postgresql.service
2020-10-07 13:49:40 +05:00
systemctl disable postgresql.service