---
# https://docs.travis-ci.com/user/multi-os/
matrix:
  include:
    - os: osx
      language: generic
      env:
        - TARGET=localhost
        - CONNECTION=local
    - os: linux
      dist: trusty
      language: python
      python: 2.7
      services:
        - docker
      addons:
        apt:
          packages:
          - python-pip
      before_script:
        - docker run -it -d --name container python:2 /bin/bash
        # Workaround: Docker connection plugin of Ansible requires that
        # Python is installed at specified path(/usr/bin/python) in the target container
        - docker exec container ln -s /usr/local/bin/python /usr/bin/python
      after_script:
        - docker rm -f container
      env:
        - TARGET=container
        - CONNECTION=docker

# This role needs sudo, thus we can't use the new container infrastructure
# sudo: false
sudo: required

install:
  - sudo pip install ansible
  # Resolve dependencies(When target role isn't installed via Ansible Galaxy, auto resolution of dependencies doesn't occur.)
  - ansible-galaxy install FGtatsuro.python-requirements

script:
  # Basic role syntax check
  - ansible-playbook tests/test.yml -i tests/inventory --syntax-check
  - ansible-playbook tests/test.yml -i tests/inventory -l ${TARGET} --connection=${CONNECTION} -vvvv
  - bundle install
  - bundle exec rake spec SPEC_TARGET=${TARGET}

notifications:
  webhooks: https://galaxy.ansible.com/api/v1/notifications/

---
# https://docs.travis-ci.com/user/multi-os/
matrix:
  include:
    - os: osx
      language: generic
      env:
        - TARGET=localhost
        - CONNECTION=local
    - os: linux
      dist: trusty
      language: python
      python: 2.7
      services:
        - docker
      addons:
        apt:
          packages:
          - python-pip
      before_script:
        - docker run -it -d --name container python:2 /bin/bash
        # Workaround: Docker connection plugin of Ansible requires that
        # Python is installed at specified path(/usr/bin/python) in the target container
        - docker exec container ln -s /usr/local/bin/python /usr/bin/python
      after_script:
        - docker rm -f container
      env:
        - TARGET=container
        - CONNECTION=docker
    - os: linux
      language: python
      python: 2.7
      before_install:
        - rvm install 2.2.3
      env:
        - TARGET=localhost
        - CONNECTION=local

# This role needs sudo, thus we can't use the new container infrastructure
# sudo: false
sudo: required

install:
  - sudo pip install ansible
  # Resolve dependencies(When target role isn't installed via Ansible Galaxy, auto resolution of dependencies doesn't occur.)
  - ansible-galaxy install FGtatsuro.python-requirements

script:
  # Basic role syntax check
  - ansible-playbook tests/test.yml -i tests/inventory --syntax-check
  - ansible-playbook tests/test.yml -i tests/inventory -l ${TARGET} --connection=${CONNECTION} -vvvv
  - bundle install
  - bundle exec rake spec SPEC_TARGET=${TARGET}

notifications:
  webhooks: https://galaxy.ansible.com/api/v1/notifications/

Add test for Ubuntu precise(=Default environment of TravisCI/CircleCI).
Add test for Ubuntu precise(=Default environment of TravisCI/CircleCI).
