dependencies:
  cache_directories:
    - ~/rethinkdb
  pre:
    - |
      if [ ! -f ~/rethinkdb/*.deb ] ; then
        source /etc/lsb-release && echo "deb http://download.rethinkdb.com/apt $DISTRIB_CODENAME main" | sudo tee /etc/apt/sources.list.d/rethinkdb.list
        wget -qO- http://download.rethinkdb.com/apt/pubkey.gpg | sudo apt-key add -
        sudo apt-get update
        mkdir ~/rethinkdb
        cd ~/rethinkdb
        apt-get download rethinkdb
      fi
    - sudo dpkg -i ~/rethinkdb/*.deb
  post:
    - rethinkdb:
        background: true

test:
  pre:
    - sleep 30
  override:
    - npm run test
  post:
    - cp coverage.html $CIRCLE_ARTIFACTS

machine:
  node:
    version: 0.12.0

dependencies:
  cache_directories:
    - ~/rethinkdb
  pre:
    - |
      if [ ! -f ~/rethinkdb/*.deb ] ; then
        source /etc/lsb-release && echo "deb http://download.rethinkdb.com/apt $DISTRIB_CODENAME main" | sudo tee /etc/apt/sources.list.d/rethinkdb.list
        wget -qO- http://download.rethinkdb.com/apt/pubkey.gpg | sudo apt-key add -
        sudo apt-get update
        mkdir ~/rethinkdb
        cd ~/rethinkdb
        apt-get download rethinkdb
      fi
    - sudo dpkg -i ~/rethinkdb/*.deb
  post:
    - rethinkdb:
        background: true

test:
  pre:
    - sleep 10
  override:
    - npm run test
  post:
    - cp coverage.html $CIRCLE_ARTIFACTS

Make CircleCI use node v0.12.0
Make CircleCI use node v0.12.0
