services:
  - elasticsearch

env:
  - PLATFORM=centos-6
  - PLATFORM=centos-7
  - PLATFORM=debian-wheezy
  - PLATFORM=debian-jessie
  - PLATFORM=ubuntu-precise
  - PLATFORM=ubuntu-trusty

sudo: true

install:
  - curl -sLo - https://github.com/moul/travis-docker/raw/master/install.sh | sh -xe

# Wait for Elasticsearch to spin up
before_script:
  - sleep 10
  - ifconfig
  - hostname
  - curl http://localhost:9200/

script:
  - ./run 'docker build -f tests/$PLATFORM.Dockerfile -t test-$PLATFORM . && docker run --name $PLATFORM test-$PLATFORM'

services:
  - elasticsearch

env:
  - PLATFORM=centos-6
  - PLATFORM=centos-7
  - PLATFORM=debian-wheezy
  - PLATFORM=debian-jessie
  - PLATFORM=ubuntu-precise
  - PLATFORM=ubuntu-trusty

sudo: true

install:
  - curl -sLo - https://github.com/moul/travis-docker/raw/master/install.sh | sh -xe

# Wait for Elasticsearch to spin up
before_script:
  - export HOST_IP=$(ifconfig venet0 | grep -Eo 'inet addr:[0-9]+\.[0-9]+\.[0-9]\.[0-9]+' | grep -Eo '[0-9]+\.[0-9]+\.[0-9]\.[0-9]+')
  - echo "$HOST_IP"
  - sed -i "s/127\.0\.0\.1/$HOST_IP/" /vagrant/inventory
  - curl http://localhost:9200/_nodes?pretty

script:
  - ./run 'docker build -f tests/$PLATFORM.Dockerfile -t test-$PLATFORM . && docker run --name $PLATFORM test-$PLATFORM'

Debug Elasticsearch connection on Travis CI.
Debug Elasticsearch connection on Travis CI.
