Using MongoDB 2.6 with TravisCI Builds

At the time of writing this post TravisCI uses mongodb 2.4 (when you put in mongodb under services in .travis.yml) and does not support the new version 2.6 ‘out of the box’. However, if you do need 2.6 for your code to run properly you could easily install it your self. You can add the following to your before_install (in .travis.yml) to do that.

.travis.yml

before_install:  
  - "sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10"
  - "echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' | sudo tee /etc/apt/sources.list.d/mongodb.list"
  - "sudo apt-get update"
  - "sudo apt-get install mongodb-org-server”

References
https://github.com/travis-ci/travis-ci/issues/2246
https://github.com/kraih/mango/blob/master/.travis.yml