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: Separating Postgres & Mongo scripts #6505

Merged
merged 65 commits into from
Mar 19, 2020
Merged
Show file tree
Hide file tree
Changes from 63 commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
841768c
Attempting to fix Postgres issue
cbaker6 Mar 14, 2020
33da65e
Attempting to fix Postgres issue
cbaker6 Mar 14, 2020
43b714d
Attempting to fix Postgres
cbaker6 Mar 14, 2020
8010633
Attempting to fix Postgres issue
cbaker6 Mar 14, 2020
cc2506a
Attempting to fix postgres
cbaker6 Mar 14, 2020
05181a7
Attempting to fix postgres
cbaker6 Mar 14, 2020
1ff769d
Attempting to fix postgres
cbaker6 Mar 14, 2020
fba1b83
Attempting to fix postgres
cbaker6 Mar 14, 2020
edf60e8
Attempting to fix postgres
cbaker6 Mar 14, 2020
c884e5d
Attempting to fix postgres
cbaker6 Mar 14, 2020
e553200
Attempting to fix postgres
cbaker6 Mar 14, 2020
c7b4411
Attempting to fix postgres
cbaker6 Mar 14, 2020
063dd2f
Attempting to fix postgres
cbaker6 Mar 14, 2020
d357a47
Attempting to fix postgres
cbaker6 Mar 14, 2020
b048966
Attempting to fix postgres
cbaker6 Mar 14, 2020
299b91d
Attempting to fix postgres
cbaker6 Mar 14, 2020
6adf026
Attempting to fix postgres
cbaker6 Mar 14, 2020
87e37a1
Attempting to fix postgres
cbaker6 Mar 14, 2020
c20a82e
Attempting to fix postgres
cbaker6 Mar 14, 2020
76a29d0
Attempting to fix postgres
cbaker6 Mar 14, 2020
b90abc4
Update .travis.yml
cbaker6 Mar 14, 2020
5d4019d
Attempting to fix postgres
cbaker6 Mar 14, 2020
028daee
Attempting to fix postgres
cbaker6 Mar 14, 2020
387258c
Attempting to fix postgres
cbaker6 Mar 14, 2020
dc3afa6
Attempting to fix postgres
cbaker6 Mar 14, 2020
06045a5
Attempting to fix postgres
cbaker6 Mar 14, 2020
ebcbbb0
Attempting to fix postgres
cbaker6 Mar 14, 2020
72f72a1
Attempting to fix postgres
cbaker6 Mar 14, 2020
2047e2e
Attempting to fix postgres
cbaker6 Mar 14, 2020
fa10637
Attempting to fix postgres
cbaker6 Mar 14, 2020
0bdc4f4
Temporary fix: separated mongo and postgres in travis
cbaker6 Mar 14, 2020
d60203d
Allowing all postgres to fail
cbaker6 Mar 14, 2020
a7c964b
Allowing multiple names to fail
cbaker6 Mar 14, 2020
d3e795a
Removing preinstalled versions of postgres from list
cbaker6 Mar 15, 2020
b0e224f
Use postgres made for dist
cbaker6 Mar 15, 2020
98d83e9
Second round
cbaker6 Mar 15, 2020
ddd6f4a
Round 3
cbaker6 Mar 15, 2020
efa17ff
Round 4
cbaker6 Mar 15, 2020
6a98945
Round 5
cbaker6 Mar 15, 2020
a3f72b8
Fixed issue with random postgres fail
cbaker6 Mar 15, 2020
5999aff
Added back postgres 11 and 12 to allow_failures
cbaker6 Mar 15, 2020
579124c
added travis scripts for postgres
cbaker6 Mar 17, 2020
38a2b9e
Setting up before_install and before_script
cbaker6 Mar 17, 2020
8b0f875
make scripts executable
cbaker6 Mar 17, 2020
ac3be67
Merge branch 'master' of https://github.com/netreconlab/parse-server
cbaker6 Mar 17, 2020
0052963
Update .travis.yml
cbaker6 Mar 17, 2020
a375604
add sourcing in script
cbaker6 Mar 17, 2020
8d26cbc
trying to fix source
cbaker6 Mar 17, 2020
dfcbe0d
fixing env var in script
cbaker6 Mar 17, 2020
a5aa417
fixed ; near then
cbaker6 Mar 17, 2020
cc91dc4
Cleaning up travis file
cbaker6 Mar 17, 2020
0e33072
Finishing clean up
cbaker6 Mar 17, 2020
773ca67
Fixing allow_failures since "name" was removed
cbaker6 Mar 17, 2020
fe0077c
Update .travis.yml
cbaker6 Mar 17, 2020
559e0a7
Removed Postgres 11 from allow_failures
cbaker6 Mar 17, 2020
2ceff98
I think using travis default postgres port of 5433 will allow us to n…
cbaker6 Mar 17, 2020
57a81cb
Merge branch 'master' of https://github.com/netreconlab/parse-server
cbaker6 Mar 17, 2020
7776457
Switching travis to postgres port 5433
cbaker6 Mar 17, 2020
59a3e8a
modifying script for test
cbaker6 Mar 17, 2020
3a099c1
modifying script for test
cbaker6 Mar 17, 2020
fc2006d
modifying script for test
cbaker6 Mar 17, 2020
4ffee37
reverting back to working way with removing postgres from image
cbaker6 Mar 17, 2020
8d17b04
Reverted back to removing postgres from image
cbaker6 Mar 17, 2020
84b4a64
removing postgres 12
cbaker6 Mar 18, 2020
839d3e6
removed postgres-12 from allow_failures
cbaker6 Mar 19, 2020
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
37 changes: 22 additions & 15 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,6 @@ dist: xenial
services:
- redis
- docker
addons:
postgresql: '11'
apt:
packages:
- postgresql-11-postgis-2.5
- postgresql-11-postgis-2.5-scripts
branches:
only:
- master
Expand All @@ -27,22 +21,14 @@ env:
jobs:
- MONGODB_VERSION=4.0.4 MONGODB_TOPOLOGY=replicaset MONGODB_STORAGE_ENGINE=wiredTiger
- MONGODB_VERSION=3.6.9
- PARSE_SERVER_TEST_DB=postgres
- PARSE_SERVER_TEST_CACHE=redis
- NODE_VERSION=12.12.0
before_install:
- nvm install $NODE_VERSION
- nvm use $NODE_VERSION
- npm install -g greenkeeper-lockfile@1
- sudo sed -i 's/port = 5433/port = 5432/' /etc/postgresql/11/main/postgresql.conf
- sudo cp /etc/postgresql/{10,11}/main/pg_hba.conf
- sudo service postgresql stop
- sudo service postgresql start 11
before_script:
- node -e 'require("./lib/index.js")'
- psql -c 'create database parse_server_postgres_adapter_test_database;' -U postgres
- psql -c 'CREATE EXTENSION postgis;' -U postgres -d parse_server_postgres_adapter_test_database
- psql -c 'CREATE EXTENSION postgis_topology;' -U postgres -d parse_server_postgres_adapter_test_database
- greenkeeper-lockfile-update
script:
- npm run lint
Expand All @@ -52,8 +38,29 @@ after_script:
- bash <(curl -s https://codecov.io/bash)
jobs:
allow_failures:
- env: NODE_VERSION=12.12.0
- env: NODE_VERSION=12.12.0
- env: POSTGRES_MAJOR_VERSION=12 PARSE_SERVER_TEST_DB=postgres
include:
- stage:
addons:
postgresql: '11'
apt:
packages:
- postgresql-11-postgis-2.5
- postgresql-11-postgis-2.5-scripts
env: POSTGRES_MAJOR_VERSION=11 PARSE_SERVER_TEST_DB=postgres
before_install: bash scripts/before_install_postgres.sh
before_script: bash scripts/before_script_postgres.sh
- stage:
addons:
postgresql: '12'
cbaker6 marked this conversation as resolved.
Show resolved Hide resolved
apt:
packages:
- postgresql-12-postgis-2.5
- postgresql-12-postgis-2.5-scripts
env: POSTGRES_MAJOR_VERSION=12 PARSE_SERVER_TEST_DB=postgres
before_install: bash scripts/before_install_postgres.sh
before_script: bash scripts/before_script_postgres.sh
- stage: release
node_js: '10'
env:
Expand Down
36 changes: 36 additions & 0 deletions scripts/before_install_postgres.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/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

sudo sed -i 's/port = 5433/port = 5432/' /etc/postgresql/${POSTGRES_MAJOR_VERSION}/main/postgresql.conf

if [[ $POSTGRES_MAJOR_VERSION -lt 11 ]]; then
# Setup postgres 9 or 10
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 ${POSTGRES_MAJOR_VERSION}

else

# Setup postgres 11 or higher
sudo cp /etc/postgresql/{10,${POSTGRES_MAJOR_VERSION}}/main/pg_hba.conf
sudo service postgresql stop
# Remove previous versions of postgres
sudo apt-get remove -q 'postgresql-9.*' 'postgresql-10.*'
sudo service postgresql start ${POSTGRES_MAJOR_VERSION}
fi
15 changes: 15 additions & 0 deletions scripts/before_script_postgres.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash

set -e

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

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

psql -v ON_ERROR_STOP=1 --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