---
branches:
  only:
  - master

# https://docs.travis-ci.com/user/multi-os/
matrix:
    - os: linux
      dist: trusty
      language: python
      python: 2.7
      services:
        - docker
      addons:
        apt:
          packages:
          - python-pip

sudo: required

install:
  - pip install ansible
  - ansible-galaxy install -r role_requirements.yml
  - gem install bundler
  - bundle install

script:
  - git clone https://github.com/FGtatsuro/ansible_utility.git
  - ansible-playbook provision/main.yml -i spec/inventory/docker/hosts -l cluster --extra-vars="utility_module_path=../ansible_utility"
  - docker rm -f service-cluster-consul service-cluster-nomad
  - bundle exec rake cluster:start-server(testserver,127.0.0.1,nil,1)
  - bundle exec rake cluster:spec:all
  - bundle exec rake cluster:stop-server
  - bundle exec rake cluster:start-client(testclient,127.0.0.1,127.0.0.1)
  - bundle exec rake cluster:spec:all
  - bundle exec rake cluster:stop-client

---
branches:
  only:
  - master

os: linux
dist: trusty
language: python
python: 2.7
services:
  - docker
addons:
  apt:
    packages:
      - python-pip

sudo: required

install:
  - pip install ansible
  - ansible-galaxy install -r role_requirements.yml
  - gem install bundler
  - bundle install

script:
  - git clone https://github.com/FGtatsuro/ansible_utility.git
  - ansible-playbook provision/main.yml -i spec/inventory/docker/hosts -l cluster --extra-vars="utility_module_path=../ansible_utility"
  - docker rm -f service-cluster-consul service-cluster-nomad
  - bundle exec rake cluster:start-server(testserver,127.0.0.1,nil,1)
  - bundle exec rake cluster:spec:all
  - bundle exec rake cluster:stop-server
  - bundle exec rake cluster:start-client(testclient,127.0.0.1,127.0.0.1)
  - bundle exec rake cluster:spec:all
  - bundle exec rake cluster:stop-client

Remove build matrix for one environment.
Remove build matrix for one environment.
