11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
# File 'lib/sambot/domain/chef/kitchen.rb', line 11
def self.generate_yml(cookbook_name, platforms, suites = nil)
raise ApplicationError, 'Missing platforms when trying to generate Test-Kitchen YAML.' unless platforms
raise ApplicationError, 'Missing cookbook name when trying to generate Test-Kitchen YAML.' unless cookbook_name
test_kitchen_configs = {
"#{KITCHEN_LOCAL_YML}": read_template(KITCHEN_LOCAL_YML, cookbook_name, platforms),
"#{KITCHEN_GCP_YML}": read_template(KITCHEN_GCP_YML, cookbook_name, platforms),
"#{KITCHEN_RACKSPACE_YML}": read_template(KITCHEN_RACKSPACE_YML, cookbook_name, platforms)
}
test_kitchen_configs.each do |key, value|
value['suites'] = suites if suites
test_kitchen_configs[key] = value.to_yaml
end
test_kitchen_configs
end
|