Skip to content

Commit 240f365

Browse files
committed
fix: migrate to Policyfile and clean up checks
1 parent 7be7fd0 commit 240f365

11 files changed

Lines changed: 51 additions & 34 deletions

.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

.kitchen.appveyor.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ driver:
1313

1414
provisioner:
1515
name: chef_zero
16+
policyfile: Policyfile.rb
1617

1718
platforms:
1819
- name: windows-2012r2
@@ -21,11 +22,8 @@ platforms:
2122

2223
suites:
2324
- name: default
24-
run_list:
25-
- recipe[visualstudio]
26-
- recipe[visualstudio::install_update]
27-
- recipe[visualstudio::install_vsto]
28-
- recipe[minitest-handler]
25+
provisioner:
26+
named_run_list: default
2927
attributes:
3028
visualstudio:
3129
source: "http://download.microsoft.com/download/b/e/d/bedddfc4-55f4-4748-90a8-ffe38a40e89f/"

.kitchen.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ driver:
1212

1313
provisioner:
1414
name: chef_zero
15+
policyfile: Policyfile.rb
1516

1617
platforms:
1718
- name: windows-2012r2
@@ -20,11 +21,8 @@ platforms:
2021

2122
suites:
2223
- name: default
23-
run_list:
24-
- recipe[visualstudio]
25-
- recipe[visualstudio::install_update]
26-
- recipe[visualstudio::install_vsto]
27-
- recipe[minitest-handler]
24+
provisioner:
25+
named_run_list: default
2826
attributes:
2927
visualstudio:
3028
source: "http://download.microsoft.com/download/b/e/d/bedddfc4-55f4-4748-90a8-ffe38a40e89f/"

.rubocop.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
Chef/Modernize/SevenZipArchiveResource:
3+
Exclude:
4+
- providers/edition.rb
5+
- providers/update.rb
6+
7+
Style/MultilineBlockChain:
8+
Exclude:
9+
- spec/install_spec.rb

Berksfile

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

Policyfile.rb

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# frozen_string_literal: true
2+
3+
name 'visualstudio'
4+
5+
default_source :supermarket
6+
7+
run_list 'recipe[visualstudio]'
8+
9+
named_run_list :default,
10+
'recipe[visualstudio]',
11+
'recipe[visualstudio::install_update]',
12+
'recipe[visualstudio::install_vsto]',
13+
'recipe[minitest-handler]'
14+
15+
cookbook 'visualstudio', path: '.'
16+
cookbook 'minitest-handler',
17+
git: 'https://github.com/b-dean/minitest-handler-cookbook.git',
18+
branch: 'chef-13-fix'
19+
cookbook 'sqlce'

README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -53,17 +53,17 @@ If you _really_ want to install VS 2015 on Windows Server 2012R2 over naked WinR
5353

5454
### Optional
5555

56-
| Key | Type | Description | Default |
57-
|-----|------|-------------|---------|
58-
| `['visualstudio']['source']` | URL | HTTP(S) root URL beneath which ISOs for all versions/editions of Visual Studio are stored. | |
59-
| `['visualstudio'][VERSION][EDITION]['source']` | URL | HTTP(S) root URL beneath which the ISO for a specific `VERSION` and `EDITION` of Visual Studio is stored. `VERSION` and `EDITION` should be replaced with one of the supported Visual Studio versions/editions. This attribute, when set, takes precedence over `node['visualstudio']['source']`. | |
60-
| `['visualstudio'][VERSION]['update']['source']` | URL | HTTP(S) root URL beneath which the update ISO for a specific `VERSION` is stored. | |
61-
| `['visualstudio']['edition']` | Boolean | The Visual Studio edition to install, i.e. community, professional, premium, ultimate, testprofessional. | `community` |
62-
| `['visualstudio']['version']` | Integer | The Visual Studio version to install, i.e. 2010, 2012, 2013, 2015. | `2015` |
63-
| `['visualstudio']['enable_nuget_package_restore']` | Boolean | Sets the system wide environment variable to enable MSBuild/Visual Studio package restore on build. | `True` |
64-
| `['visualstudio']['installs']` | Array | An array of hashes that contain the various versions and editions of Visual Studio to install. See Usage below for an example. | |
65-
| `['visualstudio']['install_items'][FEATURE]['selected']` | Boolean | Configures the feature on/off. This currently applies to all versions/editions being installed. | |
66-
| `['visualstudio']['2010']['professional']['config_file']` | String | The name of the Visual Studio 2010 unattend.ini template to use. | |
56+
| Key | Type | Description | Default
57+
| --- | ---- | ----------- | -------
58+
| `['visualstudio']['source']` | URL | HTTP(S) root URL beneath which ISOs for all versions/editions of Visual Studio are stored. | -
59+
| `['visualstudio'][VERSION][EDITION]['source']` | URL | HTTP(S) root URL beneath which the ISO for a specific `VERSION` and `EDITION` of Visual Studio is stored. `VERSION` and `EDITION` should be replaced with one of the supported Visual Studio versions/editions. This attribute, when set, takes precedence over `node['visualstudio']['source']`. | -
60+
| `['visualstudio'][VERSION]['update']['source']` | URL | HTTP(S) root URL beneath which the update ISO for a specific `VERSION` is stored. | -
61+
| `['visualstudio']['edition']` | Boolean | The Visual Studio edition to install, i.e. community, professional, premium, ultimate, testprofessional. | `community`
62+
| `['visualstudio']['version']` | Integer | The Visual Studio version to install, i.e. 2010, 2012, 2013, 2015. | `2015`
63+
| `['visualstudio']['enable_nuget_package_restore']` | Boolean | Sets the system wide environment variable to enable MSBuild/Visual Studio package restore on build. | `True`
64+
| `['visualstudio']['installs']` | Array | An array of hashes that contain the various versions and editions of Visual Studio to install. See Usage below for an example. | -
65+
| `['visualstudio']['install_items'][FEATURE]['selected']` | Boolean | Configures the feature on/off. This currently applies to all versions/editions being installed. | -
66+
| `['visualstudio']['2010']['professional']['config_file']` | String | The name of the Visual Studio 2010 unattend.ini template to use. | -
6767

6868
## Usage
6969

chefignore

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,8 @@ test/*
8383
*/.hg/*
8484
*/.svn/*
8585

86-
# Berkshelf #
87-
#############
88-
Berksfile
89-
Berksfile.lock
86+
# Dependency cache #
87+
####################
9088
cookbooks/*
9189
tmp
9290

@@ -98,7 +96,6 @@ Gemfile.lock
9896

9997
# Policyfile #
10098
##############
101-
Policyfile.rb
10299
Policyfile.lock.json
103100

104101
# Documentation #

kitchen.global.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ provisioner:
55
product_version: <%= ENV['CHEF_VERSION'] || 'latest' %>
66
channel: stable
77
install_strategy: once
8+
policyfile: Policyfile.rb
89
chef_license: accept
910
enforce_idempotency: <%= ENV['ENFORCE_IDEMPOTENCY'] || true %>
1011
multiple_converge: <%= ENV['MULTIPLE_CONVERGE'] || 2 %>

spec/install_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@
148148
end
149149
end
150150

151-
let(:config_xml_path) { 'c:\var\chef\cache\2015\professional\AdminDeployment.xml' }
151+
let(:config_xml_path) { ::File.expand_path('c:\var\chef\cache\2015\professional\AdminDeployment.xml').tr('/', '\\') }
152152
it 'customizes the AdminDeployment.xml when install_items set on the node' do
153153
opts = {
154154
step_into: ['visualstudio_edition'],

0 commit comments

Comments
 (0)