-
Notifications
You must be signed in to change notification settings - Fork 23
/
.travis.yml
81 lines (71 loc) · 3.29 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
os:
- linux
dist: trusty
sudo: required
env:
global:
- PGVERSION=9.6
addons:
postgresql: "9.6"
mariadb: "10.1"
apt:
packages:
- postgresql-9.6
- postgresql-server-dev-9.6
- postgresql-contrib-9.6
- python-setuptools
services:
- postgresql
language: node_js
node_js:
- "node"
notifications:
email:
webhooks:
urls:
- https://webhooks.gitter.im/e/3d28101cc9cfe19e264c
on_success: change
on_failure: always
on_start: never
install:
- sudo curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain nightly
- sudo ln -s ~/.cargo/bin/cargo /usr/local/bin/cargo
- sudo ln -s ~/.cargo/bin/rustc /usr/local/bin/rustc
- sudo easy_install pgxnclient
- sudo bash -c "pgxn install jsoncdc"
before_script:
- sudo bash -c "cat test/config/bin-log.cnf >> /etc/mysql/conf.d/bin-log.cnf"
- sudo bash -c "cat test/config/pg_hba.conf > /etc/postgresql/$PGVERSION/main/pg_hba.conf"
- sudo bash -c "cat test/config/postgresql.conf >> /etc/postgresql/$PGVERSION/main/postgresql.conf"
- sudo bash -c "cat test/config/redis.conf >> /etc/redis/redis.conf"
- sudo service redis-server start
- mkdir the_hatch
- wget https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-ubuntu1404-3.4.1.tgz -O /tmp/mongodb.tgz
- tar -xvf /tmp/mongodb.tgz
- ${PWD}/mongodb-linux-x86_64-ubuntu1404-3.4.1/bin/mongod --port 27017 --dbpath the_hatch --replSet rs0 --oplogSize 20 --noprealloc --fork --smallfiles --logpath mongodb.log
- until nc -z localhost 27017; do echo Waiting for MongoDB; sleep 1; done
- ${PWD}/mongodb-linux-x86_64-ubuntu1404-3.4.1/bin/mongo lapidus --eval 'printjson(rs.initiate());'
- sudo service mysql stop
- sudo service postgresql stop 9.6
- sleep 10
- ${PWD}/mongodb-linux-x86_64-ubuntu1404-3.4.1/bin/mongo lapidus --eval 'db.getMongo().setSlaveOk();'
- ${PWD}/mongodb-linux-x86_64-ubuntu1404-3.4.1/bin/mongo lapidus --eval 'db.createUser({user:"lapidus",pwd:"2PQM9aiKMJX5chv76gYdFJNi",roles:[{role:"clusterAdmin",db:"admin"},{role:"readAnyDatabase",db:"admin"},"readWrite"]});'
- ${PWD}/mongodb-linux-x86_64-ubuntu1404-3.4.1/bin/mongo lapidus --eval 'db.createUser({user:"walt",pwd:"EnlmLSvK6XeneMKZOhXGEnNtvUgHtuFV2ZZi",roles:[{role:"clusterAdmin",db:"admin"},{role:"readAnyDatabase",db:"admin"},"readWrite"]});'
- sudo service postgresql start 9.6
- sudo service postgresql status
- sudo service mysql start
- sudo service mysql status
- sudo cp /home/travis/build/JarvusInnovations/lapidus/test/sql/postgresql_setup.sql /tmp
- sudo chown postgres:postgres /tmp/postgresql_setup.sql
- sudo su postgres -c "psql -f /tmp/postgresql_setup.sql"
- mysql -e "CREATE DATABASE jacob;" -uroot
- mysql -e "CREATE DATABASE sawyer;" -uroot
- mysql -e "CREATE USER 'jacob'@'localhost' IDENTIFIED BY '2PQM9aiKMJX5chv76gYdFJNi';" -uroot
- mysql -e "CREATE USER 'sawyer'@'localhost' IDENTIFIED BY '2PQM9aiKMJX5chv76gYdFJNi';" -uroot
- mysql -e "GRANT SELECT, REPLICATION SLAVE, REPLICATION CLIENT ON *.* TO 'jacob'@'localhost';" -uroot
- mysql -e "GRANT SELECT, REPLICATION SLAVE, REPLICATION CLIENT ON *.* TO 'sawyer'@'localhost';" -uroot
- mysql -e "FLUSH PRIVILEGES;" -uroot
- npm install
script: "npm run-script test-travis"
after_script: "cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js"