sudo: required

services:
  - docker

before_install:
  - sudo curl -L "https://github.com/docker/compose/releases/download/1.11.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
  - sudo chmod +x /usr/local/bin/docker-compose

script:
  - sudo docker-compose up -d
  - wait 5
  - if [[ ! -f "~/contents/unifi/data:/var/lib/unifi/keystore" ]]; then exit 1; fi

sudo: required

services:
  - docker

env:
  - DOCKER_VERSION: 1.13.1-0~ubuntu-trusty
  - COMPOSE_VERSION: 1.11.2

before_install:
  # list docker-engine versions
  - apt-cache madison docker-engine

  # upgrade docker-engine to specific version
  - sudo apt-get -o Dpkg::Options::="--force-confnew" install -y docker-engine=${DOCKER_VERSION}
  # install docker compose
  - sudo curl -L "https://github.com/docker/compose/releases/download/${COMPOSE_VERSION}/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
  - sudo chmod +x /usr/local/bin/docker-compose

script:
  - sudo docker-compose up -d
  - wait 5
  - if [[ ! -f "~/contents/unifi/data:/var/lib/unifi/keystore" ]]; then exit 1; fi

Install specific version of docker engine to work around Travis CI's older version.
Install specific version of docker engine to work around Travis CI's older version.
