machine:
  services:
    - docker

machine:
  environment:
    CI: true
  ruby:
    version: 2.3.1

dependencies:
  cache_directories:
    - elasticsearch-2.4.1
    - bin
  post:
    - if [[ ! -d bin ]]; then mkdir bin; fi
    - if [[ ! -e elasticsearch-2.4.1 ]]; then wget https://download.elastic.co/elasticsearch/elasticsearch/elasticsearch-2.4.1.tar.gz && tar -xvf elasticsearch-2.4.1.tar.gz; fi
    - if [[ ! -e bin/phantomjs ]]; then wget -O bin/phantomjs https://s3.amazonaws.com/circle-downloads/phantomjs-2.1.1; fi
    - chmod a+x bin/phantomjs
    - sudo ln -s --force bin/phantomjs /usr/local/bin/phantomjs
    - elasticsearch-2.4.1/bin/elasticsearch: {background: true}
    - sleep 10 && curl --retry 10 --retry-delay 5 -v http://127.0.0.1:9200/

test:
  override:
    - script/test

Configure CircleCI to run builds with full dependencies
Configure CircleCI to run builds with full dependencies

- Initializes the CI environment var to discriminate between local and
  CircleCI builds.
- Sets up the right Ruby version.
- Downloads Elasticsearch 2.4.1 if not already downloaded.
- Downloads PhantomJS 2.1.1 if not already downloaded.
