sudo: required

language: bash

services:
  - docker

env:
  - ES_VERSION=6.0.0
  - ES_VERSION=5.6.4

before_install:
  # Install the latest version of Docker
  - curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
  - sudo add-apt-repository -y "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) edge"
  - sudo apt-get update -qq
  - sudo apt-get purge -y docker-engine
  - sudo apt-get install -y docker-ce

install:
  # Build and package the dictionary before testing
  - script/build.sh

  # Build the Docker image that we're going to use for testing
  - docker build --build-arg ES_VERSION=${ES_VERSION} -t ${TRAVIS_REPO_SLUG} .

before_script: >
  docker run \
    -d \
    -p 127.0.0.1:9200:9200 \
    -e "discovery.type=single-node" \
    -e "xpack.security.enabled=false" \
    ${TRAVIS_REPO_SLUG}

script:
  # Wait for Elasticsearch to start accepting incoming connections
  - wget --retry-connrefused --tries=30 --wait=1 --spider --quiet http://127.0.0.1:9200/

  # Start testing!
  - script/test.sh

sudo: required

language: bash

services:
  - docker

env:
  - ES_VERSION=6.0.0
  - ES_VERSION=5.6.4

before_install:
  # Install the latest version of Docker
  - sudo apt-get update -qq
  - sudo apt-get install -y docker-ce

install:
  # Build and package the dictionary before testing
  - script/build.sh

  # Build the Docker image that we're going to use for testing
  - docker build --build-arg ES_VERSION=${ES_VERSION} -t ${TRAVIS_REPO_SLUG} .

before_script: >
  docker run \
    -d \
    -p 127.0.0.1:9200:9200 \
    -e "discovery.type=single-node" \
    -e "xpack.security.enabled=false" \
    ${TRAVIS_REPO_SLUG}

script:
  # Wait for Elasticsearch to start accepting incoming connections
  - wget --retry-connrefused --tries=30 --wait=1 --spider --quiet http://127.0.0.1:9200/

  # Start testing!
  - script/test.sh

Simplify Docker installation inside Travis CI
Simplify Docker installation inside Travis CI
