Skip to content

Commit 425fb89

Browse files
authored
Merge pull request #1631 from MongoEngine/fix_travis_ci
Fix .install_mongodb_on_travis.sh script (all credit to @erdenezul)
2 parents 3794b18 + 21d1faa commit 425fb89

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

.install_mongodb_on_travis.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#!/bin/bash
22

3+
sudo apt-get remove mongodb-org-server
34
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
45

56
if [ "$MONGODB" = "2.4" ]; then
@@ -13,11 +14,14 @@ elif [ "$MONGODB" = "2.6" ]; then
1314
sudo apt-get install mongodb-org-server=2.6.12
1415
# service should be started automatically
1516
elif [ "$MONGODB" = "3.0" ]; then
16-
echo "deb http://repo.mongodb.org/apt/ubuntu precise/mongodb-org/3.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb.list
17+
echo "deb http://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb.list
1718
sudo apt-get update
1819
sudo apt-get install mongodb-org-server=3.0.14
1920
# service should be started automatically
2021
else
2122
echo "Invalid MongoDB version, expected 2.4, 2.6, or 3.0."
2223
exit 1
2324
fi;
25+
26+
mkdir db
27+
1>db/logs mongod --dbpath=db &

.travis.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ matrix:
4242

4343
before_install:
4444
- bash .install_mongodb_on_travis.sh
45+
- sleep 15 # https://docs.travis-ci.com/user/database-setup/#MongoDB-does-not-immediately-accept-connections
46+
- mongo --eval 'db.version();'
4547

4648
install:
4749
- sudo apt-get install python-dev python3-dev libopenjpeg-dev zlib1g-dev libjpeg-turbo8-dev

0 commit comments

Comments
 (0)