language: ruby
rvm: 2.5

sudo: required

cache: bundler

services: docker

dist: bionic

env:
  matrix:
    - TESTS="style unit" CHEF_VERSION="~> 14.0" CHEF_LICENSE=accept
    - TESTS="style unit" CHEF_VERSION="~> 15.0" CHEF_LICENSE=accept

before_install:
- chef --version &> /dev/null || curl -L https://www.getchef.com/chef/install.sh | sudo bash -s -- -P chefdk -v 4.3.13
- eval "$(/opt/chefdk/bin/chef shell-init bash)"

install:
- chef exec bundle install --jobs=3 --retry=3 --without='doc integration_vagrant integration_cloud guard'

before_script:
# https://github.com/zuazo/kitchen-in-travis-native/issues/1#issuecomment-142455888
- sudo iptables -L DOCKER || ( echo "DOCKER iptables chain missing" ; sudo iptables -N DOCKER )
- chef --version
- cookstyle --version
- foodcritic --version

script: travis_retry chef exec bundle exec rake $TESTS

language: ruby
rvm: 2.5

sudo: required

cache: bundler

services: docker

dist: bionic

env:
  matrix:
    - TESTS="style unit" CHEF_VERSION="~> 14.0" CHEF_LICENSE=accept
    - TESTS="style unit" CHEF_VERSION="~> 15.0" CHEF_LICENSE=accept
    - TESTS="style unit" CHEF_VERSION="~> 16.0" CHEF_LICENSE=accept

before_install:
- chef --version &> /dev/null || curl -L https://www.getchef.com/chef/install.sh | sudo bash -s -- -P chefdk -v 4.10.0
- eval "$(/opt/chefdk/bin/chef shell-init bash)"

install:
- chef exec bundle install --jobs=3 --retry=3 --without='doc integration_vagrant integration_cloud guard'

before_script:
# https://github.com/zuazo/kitchen-in-travis-native/issues/1#issuecomment-142455888
- sudo iptables -L DOCKER || ( echo "DOCKER iptables chain missing" ; sudo iptables -N DOCKER )
- chef --version
- cookstyle --version
- foodcritic --version

script: travis_retry chef exec bundle exec rake $TESTS

Test Chef 16, chefdk version updated
Travis: Test Chef 16, chefdk version updated
