Skip to content

Commit 7c77fdf

Browse files
authored
chore: migrate to Policyfile (#364)
* chore: migrate to Policyfile * chore: use policyfile named run lists
1 parent b826584 commit 7c77fdf

5 files changed

Lines changed: 27 additions & 23 deletions

File tree

.github/workflows/copilot-setup-steps.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ jobs:
2121
- name: Install Chef
2222
uses: actionshub/chef-install@main
2323
- name: Install cookbooks
24-
run: berks install
24+
run: chef install Policyfile.rb

Berksfile

Lines changed: 0 additions & 9 deletions
This file was deleted.

Policyfile.rb

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# frozen_string_literal: true
2+
3+
name 'ruby_rbenv'
4+
5+
default_source :supermarket
6+
7+
run_list 'test::default'
8+
9+
cookbook 'ruby_rbenv', path: '.'
10+
cookbook 'test', path: 'test/cookbooks/test'
11+
12+
Dir.entries('./test/cookbooks/test/recipes').select { |f| f.end_with?('.rb') }.each do |test|
13+
test = test.delete_suffix('.rb')
14+
named_run_list :"#{test}", "test::#{test}"
15+
end

kitchen.yml

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -38,23 +38,21 @@ suites:
3838
provisioner:
3939
enforce_idempotency: false
4040
multiple_converge: 1
41-
run_list:
42-
- recipe[test::gem]
41+
named_run_list: gem
4342
- name: global
44-
run_list:
45-
- recipe[test::global]
43+
provisioner:
44+
named_run_list: global
4645
- name: ruby_uninstall
4746
provisioner:
4847
enforce_idempotency: false
4948
multiple_converge: 1
50-
run_list:
51-
- recipe[test::ruby_uninstall]
49+
named_run_list: ruby_uninstall
5250
- name: system_install
53-
run_list:
54-
- recipe[test::system_install]
51+
provisioner:
52+
named_run_list: system_install
5553
- name: user_install
56-
run_list:
57-
- recipe[test::user_install]
54+
provisioner:
55+
named_run_list: user_install
5856
- name: custom_group_install
59-
run_list:
60-
- recipe[test::custom_group_install]
57+
provisioner:
58+
named_run_list: custom_group_install

spec/spec_helper.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# frozen_string_literal: true
22

33
require 'chefspec'
4-
require 'chefspec/berkshelf'
4+
require 'chefspec/policyfile'
55

66
RSpec.configure do |config|
77
config.color = true

0 commit comments

Comments
 (0)