Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Travis postgres update: removing unnecessary start of mongo-runner #6594

Merged
merged 4 commits into from
Apr 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ jobs:
env: POSTGRES_MAJOR_VERSION=11 PARSE_SERVER_TEST_DB=postgres PARSE_SERVER_TEST_DATABASE_URI=postgres://localhost:5433/parse_server_postgres_adapter_test_database
before_install: bash scripts/before_install_postgres.sh
before_script: bash scripts/before_script_postgres.sh
script:
- npm run lint
- npm run coverage
- stage: release
node_js: '10'
env:
Expand Down
9 changes: 7 additions & 2 deletions scripts/before_install_postgres.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
#!/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
Expand All @@ -20,7 +25,7 @@ if [[ $POSTGRES_MAJOR_VERSION -lt 11 ]]; then

sudo service postgresql start

else
else
# Setup postgres 11 or higher

#Copy defauilt hba config file and tell postgres to restart
Expand Down
6 changes: 4 additions & 2 deletions scripts/before_script_postgres.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
#!/bin/bash

set -e

echo "[SCRIPT] Before Script :: Setup Parse DB for Postgres ${POSTGRES_MAJOR_VERSION}"

node -e 'require("./lib/index.js")'
greenkeeper-lockfile-update

psql -v ON_ERROR_STOP=1 -p 5433 --username "postgres" --dbname "${POSTGRES_DB}" <<-EOSQL
CREATE DATABASE parse_server_postgres_adapter_test_database;
\c parse_server_postgres_adapter_test_database;
CREATE EXTENSION postgis;
CREATE EXTENSION postgis_topology;
EOSQL