From 9c1d961b0b640d0423e3937501f4092a91cfc85e Mon Sep 17 00:00:00 2001 From: Grant Ridder Date: Thu, 27 Apr 2017 01:21:14 -0700 Subject: [PATCH] Add kitchen-dokken testing to Travis --- .kitchen.dokken.yml | 72 +++++++++++++++++++++++++++++++++++++++++++++ .travis.yml | 22 ++++++++++++-- Gemfile | 4 +++ 3 files changed, 95 insertions(+), 3 deletions(-) create mode 100644 .kitchen.dokken.yml diff --git a/.kitchen.dokken.yml b/.kitchen.dokken.yml new file mode 100644 index 00000000..9349d54d --- /dev/null +++ b/.kitchen.dokken.yml @@ -0,0 +1,72 @@ +driver: + name: dokken + privileged: true # because Docker and SystemD/Upstart + chef_version: 12.19.36 + # chef_version: current + +transport: + name: dokken + +provisioner: + name: dokken + require_chef_omnibus: 12.19.36 + +# TODO: uncomment after converting to inspec +# verifier: +# name: inspec + +platforms: +- name: centos-6 + driver: + image: centos:6 + platform: rhel + pid_one_command: /sbin/init + intermediate_instructions: + - RUN yum -y install which initscripts net-tools wget sudo + +- name: centos-7 + driver: + image: centos:7 + platform: rhel + pid_one_command: /usr/lib/systemd/systemd + intermediate_instructions: + - RUN yum -y install lsof which systemd-sysv initscripts wget net-tools sudo + +- name: debian-7 + driver: + image: debian:7 + pid_one_command: /sbin/init + intermediate_instructions: + - RUN /usr/bin/apt-get update + - RUN /usr/bin/apt-get install -y apt-transport-https lsb-release procps net-tools sudo + +- name: debian-8 + driver: + image: debian:8 + pid_one_command: /bin/systemd + intermediate_instructions: + - RUN /usr/bin/apt-get update + - RUN /usr/bin/apt-get install -y apt-transport-https lsb-release procps net-tools sudo + +- name: fedora-latest + driver: + image: fedora:latest + pid_one_command: /usr/lib/systemd/systemd + intermediate_instructions: + - RUN dnf -y install yum which systemd-sysv initscripts wget net-tools sudo + +- name: ubuntu-14.04 + driver: + image: ubuntu-upstart:14.04 + pid_one_command: /sbin/init + intermediate_instructions: + - RUN /usr/bin/apt-get update + - RUN /usr/bin/apt-get install -y apt-transport-https lsb-release procps net-tools sudo + +- name: ubuntu-16.04 + driver: + image: ubuntu:16.04 + pid_one_command: /bin/systemd + intermediate_instructions: + - RUN /usr/bin/apt-get update + - RUN /usr/bin/apt-get install -y apt-transport-https lsb-release procps net-tools sudo diff --git a/.travis.yml b/.travis.yml index c8189f2b..ad8b0ced 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,12 +1,28 @@ language: ruby cache: bundler +services: docker +dist: trusty rvm: - 2.3.1 -sudo: false +sudo: required branches: only: - master bundler_args: --without=integration --path=.bundle +env: + global: + - KITCHEN_LOCAL_YAML=.kitchen.dokken.yml + matrix: + - CMD="rake" OPTIONS="style" + - CMD="rake" OPTIONS="spec" + - CMD="kitchen verify" OPTIONS="default-centos-6" + - CMD="kitchen verify" OPTIONS="default-centos-7" + - CMD="kitchen verify" OPTIONS="default-debian-7" + - CMD="kitchen verify" OPTIONS="default-debian-8" + - CMD="kitchen verify" OPTIONS="default-fedora-latest" + - CMD="kitchen verify" OPTIONS="default-ubuntu-1404" + - CMD="kitchen verify" OPTIONS="default-ubuntu-1604" +before_script: + - sudo iptables -L DOCKER || ( echo "DOCKER iptables chain missing" ; sudo iptables -N DOCKER ) script: - - bundle exec rake style - - bundle exec rake spec + - bundle exec $CMD $OPTIONS diff --git a/Gemfile b/Gemfile index a36a263f..73ee0eab 100644 --- a/Gemfile +++ b/Gemfile @@ -20,6 +20,10 @@ group :testing do gem 'rubocop' end +group :travis_integration do + gem 'kitchen-dokken' +end + group :integration do gem 'busser-serverspec' gem 'kitchen-vagrant'