Files
kami-parse-server/scripts/before_install_postgres.sh
Corey e6e5a8c578 Travis postgres update: removing unnecessary start of mongo-runner (#6594)
* use pg-promise native pg-connection-string to parse uri instead of ParseConfigParser.js. The allows for a more felxible uri for ssl and other params

* Revert "use pg-promise native pg-connection-string to parse uri instead of ParseConfigParser.js. The allows for a more felxible uri for ssl and other params"

This reverts commit a5926d3ff7b97f72bb0c5bced15f34942cd1a96d.

* Updating travis postgres and removing unnecessary start of mongo-runner. Ensuring before_script and before_install matches the rest of travis
2020-04-23 10:28:40 -05:00

35 lines
927 B
Bash
Executable File

#!/bin/bash
set -e
source ~/.nvm/nvm.sh
echo "[SCRIPT] Before Install Script :: Setup Postgres ${POSTGRES_MAJOR_VERSION}"
nvm install $NODE_VERSION
nvm use $NODE_VERSION
npm install -g greenkeeper-lockfile@1
if [[ $POSTGRES_MAJOR_VERSION -lt 11 ]]; then
# Setup postgres 9 or 10
sudo sed -i 's/port = 5432/port = 5433/' /etc/postgresql/${POSTGRES_MAJOR_VERSION}/main/postgresql.conf
# Stop the current running service
sudo service postgresql stop
# Remove correct version of postgres
if [[ $POSTGRES_MAJOR_VERSION -lt 10 ]]; then
sudo apt-get remove -q 'postgresql-10.*'
else
sudo apt-get remove -q 'postgresql-9.*'
fi
sudo service postgresql start
else
# Setup postgres 11 or higher
#Copy defauilt hba config file and tell postgres to restart
sudo cp /etc/postgresql/{10,${POSTGRES_MAJOR_VERSION}}/main/pg_hba.conf
sudo systemctl restart postgresql@${POSTGRES_MAJOR_VERSION}-main
fi