test: use OS environment variable for kitchen
This commit is contained in:
parent
7835763dff
commit
2c9df1967d
3 changed files with 17 additions and 29 deletions
33
.kitchen.yml
33
.kitchen.yml
|
@ -1,4 +1,8 @@
|
||||||
---
|
---
|
||||||
|
# <% os = ENV['OS'] || 'debian9' %>
|
||||||
|
# <% ansible = ENV['ANSIBLE_VERSION'] || '2.7' %>
|
||||||
|
# <% command = os == 'centos7' ? '/usr/sbin/init' : '/bin/systemd' %>
|
||||||
|
|
||||||
driver:
|
driver:
|
||||||
name: docker_cli
|
name: docker_cli
|
||||||
|
|
||||||
|
@ -15,38 +19,19 @@ provisioner:
|
||||||
ansible_inventory: ./test/integration/inventory
|
ansible_inventory: ./test/integration/inventory
|
||||||
|
|
||||||
platforms:
|
platforms:
|
||||||
- name: debian9
|
- name: <%= os %>
|
||||||
driver_config:
|
driver_config:
|
||||||
image: "nishiki/debian9:ansible-<%= ENV['ANSIBLE_VERSION'] ? ENV['ANSIBLE_VERSION'] : '2.7' %>"
|
image: "nishiki/<%= os %>:ansible-<%= ansible %>"
|
||||||
command: /bin/systemd
|
command: <%= command %>
|
||||||
volume:
|
volume:
|
||||||
- /sys/fs/cgroup:/sys/fs/cgroup:ro
|
- /sys/fs/cgroup:/sys/fs/cgroup:ro
|
||||||
security_opt: seccomp=unconfined
|
security_opt: seccomp=unconfined
|
||||||
|
# <% if os == 'debian9' %>
|
||||||
provisioner:
|
provisioner:
|
||||||
extra_vars:
|
extra_vars:
|
||||||
sensu_repository_system: ubuntu
|
sensu_repository_system: ubuntu
|
||||||
sensu_repository_release: xenial
|
sensu_repository_release: xenial
|
||||||
- name: ubuntu18.04
|
# <% end %>
|
||||||
driver_config:
|
|
||||||
image: "nishiki/ubuntu18.04:ansible-<%= ENV['ANSIBLE_VERSION'] ? ENV['ANSIBLE_VERSION'] : '2.7' %>"
|
|
||||||
command: /bin/systemd
|
|
||||||
volume:
|
|
||||||
- /sys/fs/cgroup:/sys/fs/cgroup:ro
|
|
||||||
security_opt: seccomp=unconfined
|
|
||||||
- name: ubuntu16.04
|
|
||||||
driver_config:
|
|
||||||
image: "nishiki/ubuntu16.04:ansible-<%= ENV['ANSIBLE_VERSION'] ? ENV['ANSIBLE_VERSION'] : '2.7' %>"
|
|
||||||
command: /bin/systemd
|
|
||||||
volume:
|
|
||||||
- /sys/fs/cgroup:/sys/fs/cgroup:ro
|
|
||||||
security_opt: seccomp=unconfined
|
|
||||||
- name: centos7
|
|
||||||
driver_config:
|
|
||||||
image: "nishiki/centos7:ansible-<%= ENV['ANSIBLE_VERSION'] ? ENV['ANSIBLE_VERSION'] : '2.7' %>"
|
|
||||||
command: /usr/sbin/init
|
|
||||||
volume:
|
|
||||||
- /sys/fs/cgroup:/sys/fs/cgroup:ro
|
|
||||||
security_opt: seccomp=unconfined
|
|
||||||
|
|
||||||
suites:
|
suites:
|
||||||
- name: default
|
- name: default
|
||||||
|
|
11
.travis.yml
11
.travis.yml
|
@ -3,9 +3,12 @@ sudo: required
|
||||||
language: ruby
|
language: ruby
|
||||||
|
|
||||||
env:
|
env:
|
||||||
- ANSIBLE_VERSION=2.5
|
- OS=debian9 ANSIBLE_VERSION=2.5
|
||||||
- ANSIBLE_VERSION=2.6
|
- OS=debian9 ANSIBLE_VERSION=2.6
|
||||||
- ANSIBLE_VERSION=2.7
|
- OS=debian9 ANSIBLE_VERSION=2.7
|
||||||
|
- OS=ubuntu18.04 ANSIBLE_VERSION=2.7
|
||||||
|
- OS=ubuntu16.04 ANSIBLE_VERSION=2.7
|
||||||
|
- OS=centos7 ANSIBLE_VERSION=2.7
|
||||||
|
|
||||||
services:
|
services:
|
||||||
- docker
|
- docker
|
||||||
|
@ -19,7 +22,7 @@ before_install:
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- kitchen conv
|
- kitchen conv
|
||||||
- kitchen conv default-debian9 | grep changed=0
|
- kitchen conv | grep changed=0
|
||||||
- kitchen verify
|
- kitchen verify
|
||||||
- ansible-lint -r galaxy-lint-rules/rules .
|
- ansible-lint -r galaxy-lint-rules/rules .
|
||||||
- yamllint .
|
- yamllint .
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
extends: default
|
extends: default
|
||||||
|
|
||||||
ignore: |
|
ignore: |
|
||||||
.kitchen/*
|
.kitchen*
|
||||||
vendor/
|
vendor/
|
||||||
|
|
||||||
rules:
|
rules:
|
||||||
|
|
Loading…
Reference in a new issue