sudo: required
services:
  - docker

addons:
  apt:
    packages:
    - apt-transport-https

install:
  - pip install PyYAML
  - pip install virtualenv
  - |
    test -e Gemfile || cat <<EOF > Gemfile
    source 'https://rubygems.org'
    gem 'rake'
    gem 'test-kitchen'
    gem 'kitchen-docker'
    gem 'kitchen-inspec'
    gem 'inspec'
    gem 'kitchen-salt', :git => 'https://github.com/salt-formulas/kitchen-salt.git'
  - bundle install

env:
  - PLATFORM=trevorj/salty-whales:trusty SUITE=network
  - PLATFORM=trevorj/salty-whales:xenial SUITE=network
  # - PLATFORM=trevorj/salty-whales:trusty SUITE=storage
  # - PLATFORM=trevorj/salty-whales:xenial SUITE=storage
  - PLATFORM=trevorj/salty-whales:trusty SUITE=system
  - PLATFORM=trevorj/salty-whales:xenial SUITE=system

before_script:
  - set -o pipefail
  - make test | tail

script:
  - KITCHEN_LOCAL_YAML=.kitchen.travis.yml bundle exec kitchen test -t tests/integration

notifications:
  webhooks:
    urls:
      - https://webhooks.gitter.im/e/6123573504759330786b
    on_success: change  # options: [always|never|change] default: always
    on_failure: never  # options: [always|never|change] default: always
    on_start: never     # options: [always|never|change] default: always
    on_cancel: never    # options: [always|never|change] default: always
    on_error: never    # options: [always|never|change] default: always
  email: false