This repository has been archived by the owner on Jun 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
.kitchen.yml
80 lines (67 loc) · 1.97 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
# <%
if ENV['JENKINS_COPY_CHEF_CREDENTIALS']
require 'chef/knife'
k = Chef::Knife.new
k.configure_chef
# the existance of the node_name can be taken as "this workstation has a chef setup"
def is_configured?
not Chef::Config[:node_name].nil?
end
def client_config
cfg = {}
%w{client_key node_name chef_server_url}.each{|k| cfg[k.to_sym] = Chef::Config[k]}
cfg
end
def client_key_exists?
File.exists?(Chef::Config[:client_key]) && File.readable?(Chef::Config[:client_key])
end
def client_key_contents_escaped
File.read(Chef::Config[:client_key]).gsub(/\n/, "|")
end
elsif ENV['CI']
# nothing...
else
STDERR.puts "To interact with your Chef Server, please set JENKINS_COPY_CHEF_CREDENTIALS=1"
end
%>
---
driver:
name: vagrant
customize:
cpus: 4
memory: 2048
verifier:
name: inspec
provisioner:
name: chef_zero
platforms:
- name: debian-9.0
suites:
- name: default
run_list:
- recipe[site-chefcitypo3org::default]
attributes:
jenkins_chefci:
github_organization: TYPO3-cookbooks-test
github_credentials:
login: <%= ENV['JENKINS_GITHUB_LOGIN'] %>
token: <%= ENV['JENKINS_GITHUB_TOKEN'] %>
<% if ENV['JENKINS_COPY_CHEF_CREDENTIALS'] and is_configured? %>
knife_config: <%= client_config.to_json %>
knife_client_key: '<%= client_key_contents_escaped %>'
<% end %>
site-chefcitypo3org:
main_repo: ssh://<%= ENV['JENKINS_T3O_USER'] %>@review.typo3.org:29418/Teams/Server/Chef.git
auth:
github_client_id: <%= ENV['JENKINS_GITHUB_CLIENT_ID'] %>
github_client_secret: <%= ENV['JENKINS_GITHUB_CLIENT_SECRET'] %>
driver_config:
network:
- ["private_network", {ip: "192.168.88.23"}]
- name: databag-secrets
data_bags_path: "test/integration/databag-secrets/data_bags"
run_list:
- recipe[site-chefcitypo3org::default]
driver_config:
network:
- ["private_network", {ip: "192.168.88.24"}]