-
Notifications
You must be signed in to change notification settings - Fork 1
/
.kitchen.yml
executable file
·114 lines (109 loc) · 3.37 KB
/
.kitchen.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
---
verifier:
name: inspec
format: <%= ENV['CI'] ? 'junit' : 'cli' %>
<% if ENV['CI'] %>
output: "test-reports/%{platform}_%{suite}_inspec.xml"
<% end %>
platforms:
- name: amazon-ec2
driver:
image_search:
owner-id: 137112412989
name: amzn-ami-hvm-2017.*x86_64-gp2
- name: amazon-docker
driver_config:
image: amazonlinux:latest
platform: rhel
suites:
- name: ec2
run_list:
- role[bonusbits_mediawiki_nginx]
provisioner:
name: chef_zero
require_chef_omnibus: 12.19.36
data_bags_path: test/data_bags
<% if ENV['USER'] == 'levon' %>
encrypted_data_bag_secret_key_path: <%= ENV['HOME'] %>/.chef/encrypted_data_bag_secret
<% else %>
encrypted_data_bag_secret_key_path: test/data_bags/encrypted_data_bag_secret
<% end %>
roles_path: test/roles
environments_path: test/environments
client_rb:
<% if ENV['USER'] == 'levon' %>
environment: bonusbits_dev
<% else %>
environment: kitchen
<% end %>
driver:
name: ec2
associate_public_ip: <%= ENV['AWS_PUBLIC_IP'] %>
aws_ssh_key_id: <%= ENV['AWS_SSH_KEY_ID'] %>
security_group_ids:
<% (1..5).collect { |n| ENV["AWS_SECURITY_GROUP_#{n}"] }.compact.each do |secgroup| %>
- <%= secgroup %>
<% end %>
subnet_id: <%= ENV['AWS_SUBNET'] %>
vpc_id: <%= ENV['AWS_VPC_ID'] %>
iam_profile_name: <%= ENV['AWS_IAM_INSTANCE_PROFILE_1'] %>
region: <%= ENV['AWS_REGION'] %>
instance_type: t2.small
tags:
Name: kitchen-bonusbits-web-<%= ENV['USER'] %>
Created-By: Test Kitchen
Owner: <%= ENV['USER'] %>
transport:
username: ec2-user
ssh_key: <%= ENV['AWS_SSH_KEY_PATH'] %>
verifier:
inspec_tests:
- name: bootstrap
git: https://github.com/bonusbits/inspec_bootstrap.git
- name: bonusbits_base
git: https://github.com/bonusbits/inspec_bonusbits_base.git
- path: test/inspec/profiles/bonusbits_web/
attributes:
chef_version: '12.19.36'
includes: [ 'amazon-ec2' ]
- name: docker
run_list:
- role[bonusbits_mediawiki_nginx]
provisioner:
name: chef_zero
require_chef_omnibus: 12.19.36
data_bags_path: test/data_bags
<% if ENV['USER'] == 'levon' %>
encrypted_data_bag_secret_key_path: <%= ENV['HOME'] %>/.chef/encrypted_data_bag_secret
<% else %>
encrypted_data_bag_secret_key_path: test/data_bags/encrypted_data_bag_secret
<% end %>
roles_path: test/roles
environments_path: test/environments
client_rb:
<% if ENV['USER'] == 'levon' %>
environment: bonusbits_dev
<% else %>
environment: kitchen
<% end %>
driver:
name: docker
use_sudo: false
driver_config:
ssl_verify_mode: ":verify_none"
forward: 80 443
verifier:
inspec_tests:
- name: bootstrap
git: https://github.com/bonusbits/inspec_bootstrap.git
- name: bonusbits_base
git: https://github.com/bonusbits/inspec_bonusbits_base.git
- path: test/inspec/profiles/bonusbits_web/
attributes:
chef_version: '12.19.36'
attributes:
<% if ENV['CIRCLECI'] %>
bonusbits_base:
deployment_location: 'circleci'
<% end %>
includes: [ 'amazon-docker' ]