sudo: required
dist: trusty

addons:
  apt:
    sources:
      - chef-stable-trusty
    packages:
      - chefdk

# Don't `bundle install` which takes about 1.5 mins
install: echo "skip bundle install"

branches:
  only:
    - master

services: docker

env:
  matrix:
    - INSTANCE=system-ruby-centos-6
    - INSTANCE=system-ruby-centos-7
    - INSTANCE=system-ruby-ubuntu-1404
    - INSTANCE=system-ruby-ubuntu-1604

before_script:
  - sudo iptables -L DOCKER || ( echo "DOCKER iptables chain missing" ; sudo iptables -N DOCKER )
  - eval "$(/opt/chefdk/bin/chef shell-init bash)"
  - /opt/chefdk/embedded/bin/chef --version
  - /opt/chefdk/embedded/bin/cookstyle --version
  - /opt/chefdk/embedded/bin/foodcritic --version

script: KITCHEN_LOCAL_YAML=.kitchen.dokken.yml /opt/chefdk/embedded/bin/kitchen verify ${INSTANCE}

matrix:
  include:
    - script:
      - /opt/chefdk/embedded/bin/cookstyle
      - /opt/chefdk/embedded/bin/foodcritic .
      - /opt/chefdk/embedded/bin/rspec
      env: UNIT_AND_LINT=1

sudo: required
dist: trusty

addons:
  apt:
    sources:
      - chef-stable-trusty
    packages:
      - chefdk

# Don't `bundle install` which takes about 1.5 mins
install: echo "skip bundle install"

branches:
  only:
    - master

services: docker

env:
  matrix:
    #    - INSTANCE=system-ruby-centos-6
    - INSTANCE=system-ruby-centos-7
    - INSTANCE=system-ruby-ubuntu-1404
    - INSTANCE=system-ruby-ubuntu-1604

before_script:
  - sudo iptables -L DOCKER || ( echo "DOCKER iptables chain missing" ; sudo iptables -N DOCKER )
  - eval "$(/opt/chefdk/bin/chef shell-init bash)"
  - /opt/chefdk/embedded/bin/chef --version
  - /opt/chefdk/embedded/bin/cookstyle --version
  - /opt/chefdk/embedded/bin/foodcritic --version

script: KITCHEN_LOCAL_YAML=.kitchen.dokken.yml /opt/chefdk/embedded/bin/kitchen verify ${INSTANCE}

matrix:
  include:
    - script:
      - /opt/chefdk/embedded/bin/cookstyle
      - /opt/chefdk/embedded/bin/foodcritic .
      - /opt/chefdk/embedded/bin/rspec
      env: UNIT_AND_LINT=1

Disable RHEL 6 for now as it times out in Travis
Disable RHEL 6 for now as it times out in Travis

Signed-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>
