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"

services: docker

env:
  matrix:
  - INSTANCE=default-centos-6
  - INSTANCE=default-centos-7

before_script:
  - sudo iptables -L DOCKER || ( echo "DOCKER iptables chain missing" ; sudo iptables -N DOCKER )
  - eval "$(/opt/chefdk/bin/chef shell-init bash)" && chef gem install berkshelf
  - /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}
