os: linux

dist: trusty

services: docker

language: shell

before_script:
  - env | sort
  - dir="${VARIANT}/"

script:
  - cd "$dir"
  - travis_wait docker build --build-arg VERSION=latest -t ejabberd/ecs:travis-latest .
  - docker images
  - travis_retry docker run --name ejabberd -d -p 5222:5222 ejabberd/ecs && sleep 60
  - docker ps
  - docker logs ejabberd
  - docker logs ejabberd | grep "Start accepting TCP connections" || exit 1

notifications:
  email: false

env:
  - VARIANT=ecs
  - VARIANT=mix
