---
dist: xenial
sudo: false
language: ruby
if: "((tag =~ ^v) AND (branch = master)) OR type = pull_request"
cache:
  directories:
  - "$HOME/.berkshelf"
addons:
  apt:
    sources:
    - chef-stable-trusty
    packages:
    - chefdk
before_install:
- chef --version
- eval "$(chef shell-init bash)"
install: true
jobs:
  include:
  - stage: verify
    script: chef exec delivery local verify
  - stage: acceptance
    script: chef exec delivery local acceptance
  # TODO: Add the Chef Server key for trubot (~/.chef/trubot.pem)
  # - stage: Publish to Supermarket
  #   script: echo "Uploading to Supermarket..."
  #   deploy:
  #     provider: script
  #     script: chef exec stove --no-git --username evertrue --key $HOME/.chef/trubot.pem
  #     skip_cleanup: true
  #     on:
  #       tags: true
notifications:
  slack:
    secure: iZxnXG69lc2ud7VGcvA/wsbh/hTKVDCNLZuv2orKz9sp01a/auxkROHsR1W+reXKSqHfihzFCI5z0et6IMkc9DRUKcyVH65z9D0AIqY4ateSO2KqaGJsniksiksXJp8auDc+3wKC4QUIQ0DDtGyQpwcNAPerznp6k5zpkc8hV+8=
env:
  global:
  - KITCHEN_LOCAL_YAML=.kitchen.cloud.yml

---
dist: xenial
sudo: false
language: ruby
if: (type = pull_request) OR (tag IS present)
cache:
  directories:
  - "$HOME/.berkshelf"
addons:
  apt:
    sources:
    - chef-stable-trusty
    packages:
    - chefdk
before_install:
- chef --version
- eval "$(chef shell-init bash)"
install: true
jobs:
  include:
  - stage: verify
    script: chef exec delivery local verify
  - stage: acceptance
    script: chef exec delivery local acceptance
  # TODO: Add the Chef Server key for trubot (~/.chef/trubot.pem)
  # - stage: Publish to Supermarket
  #   script: echo "Uploading to Supermarket..."
  #   deploy:
  #     provider: script
  #     script: chef exec stove --no-git --username evertrue --key $HOME/.chef/trubot.pem
  #     skip_cleanup: true
  #     on:
  #       tags: true
notifications:
  slack:
    secure: iZxnXG69lc2ud7VGcvA/wsbh/hTKVDCNLZuv2orKz9sp01a/auxkROHsR1W+reXKSqHfihzFCI5z0et6IMkc9DRUKcyVH65z9D0AIqY4ateSO2KqaGJsniksiksXJp8auDc+3wKC4QUIQ0DDtGyQpwcNAPerznp6k5zpkc8hV+8=
env:
  global:
  - KITCHEN_LOCAL_YAML=.kitchen.cloud.yml

Fix Travis config to build tags + PRs
Fix Travis config to build tags + PRs
