Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates to readme and testing #151

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion .delivery/project.toml
Original file line number Diff line number Diff line change
@@ -1 +1,9 @@
remote_file = "https://raw.githubusercontent.com/chef-cookbooks/community_cookbook_tools/master/delivery/project.toml"
[local_phases]
unit = "rspec spec/"
lint = 'cookstyle --display-cop-names --extra-details'
syntax = "echo skipping"
provision = "echo skipping"
deploy = "echo skipping"
smoke = "echo skipping"
functional = "echo skipping"
cleanup = "echo skipping"
63 changes: 63 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
---
name: ci

'on':
pull_request:
push:
branches:
- main

jobs:
delivery:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Run Chef Delivery
uses: actionshub/chef-delivery@main
env:
CHEF_LICENSE: accept-no-persist

yamllint:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Run yaml Lint
uses: actionshub/yamllint@main

mdl:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Run Markdown Lint
uses: actionshub/markdownlint@main

integration:
needs: [mdl, yamllint, delivery]
runs-on: macos-10.15
strategy:
matrix:
os:
- 'windows-2012R2'
- 'windows-2016'
- 'windows-2019'
suite:
- 'chef-infra-12'
- 'chef-infra-latest'
fail-fast: false

steps:
- name: Check out code
uses: actions/checkout@v2
- name: Install Chef
uses: actionshub/chef-install@main
- name: test-kitchen
uses: actionshub/test-kitchen@main
env:
CHEF_LICENSE: accept-no-persist
KITCHEN_LOCAL_YAML: kitchen.yml
with:
suite: ${{ matrix.suite }}
os: ${{ matrix.os }}
16 changes: 0 additions & 16 deletions .github/workflows/delivery.yml

This file was deleted.

33 changes: 0 additions & 33 deletions .kitchen.appveyor.yml

This file was deleted.

1 change: 1 addition & 0 deletions .mdlrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
rules "~MD013", "~MD024"
2 changes: 1 addition & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Style/EndOfLine:
Layout/EndOfLine:
EnforcedStyle: lf
13 changes: 13 additions & 0 deletions .yamllint
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
extends: default
rules:
line-length:
max: 256
level: warning
document-start: disable
braces:
forbid: false
min-spaces-inside: 0
max-spaces-inside: 1
min-spaces-inside-empty: -1
max-spaces-inside-empty: -1
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog for Chocolatey cookbook

## Unreleased

- Add `['install_vars']['chocolateyIgnoreProxy']` to the readme
- Add yaml/markdown linting and resolve warnings
- Move testing to Github Actions
- Update delivery toml

## v3.0.0 (2020-08-12)

- Add `node['chocolatey']['sensitive']` attribute (default: false) to give users the option to suppress output spam when the install.ps1 file is pushed to the machine.
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# chocolatey Cookbook

[![Cookbook Version](https://img.shields.io/cookbook/v/chocolatey.svg)](https://supermarket.getchef.com/cookbooks/chocolatey) ![delivery](https://github.com/chocolatey-community/chocolatey-cookbook/workflows/delivery/badge.svg)
[![Cookbook Version](https://img.shields.io/cookbook/v/chocolatey.svg)](https://supermarket.getchef.com/cookbooks/chocolatey)
[![CI State](https://github.com/chocolatey-community/chocolatey-cookbook/workflows/ci/badge.svg)](https://github.com/chocolatey-community/chocolatey-cookbook/actions?query=workflow%3Aci)

Install Chocolatey with the default recipe.

Expand All @@ -27,6 +28,7 @@ All attributes below are pre-pended with `node['chocolatey']`
Attribute | Description | Type | Default
---------------------------------------------------- | ----------------------------------------------------------------------------------------- | ------- | ---------------------------------------------------------------------------------
`['upgrade']` | Whether to upgrade Chocolatey if it's already installed | Boolean | false
`['install_vars']['chocolateyIgnoreProxy']` | Ignore proxy for Chocolatey install script | String | nil
`['install_vars']['chocolateyProxyLocation']` | HTTPS proxy for Chocolatey install script | String | Chef::Config['https_proxy'] or ENV['https_proxy']
`['install_vars']['chocolateyProxyUser']` | Proxy user for authenticating proxies | String | nil
`['install_vars']['chocolateyProxyPassword']` | Proxy user password | String | nil
Expand Down
39 changes: 0 additions & 39 deletions appveyor.yml

This file was deleted.

26 changes: 13 additions & 13 deletions .kitchen.yml → kitchen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,37 +6,37 @@ driver:
memory: 4096

provisioner:
name: chef_zero
name: chef_infra
product_name: chef

platforms:
- name: windows-2012R2
driver_config:
box: tas50/windows_2012r2
- name: windows-2016
driver_config:
box: tas50/windows_2016
- name: windows-2019
driver_config:
box: tas50/windows_2016
- name: windows-2012R2
driver_config:
box: tas50/windows_2012r2
- name: windows-2016
driver_config:
box: tas50/windows_2016
- name: windows-2019
driver_config:
box: tas50/windows_2019

verifier:
name: inspec

suites:
- name: chef_infra_12
provisioner:
product_name: chef
product_version: 12.15
run_list:
- recipe[chocolatey::default]
attributes:
chocolatey:
install_vars:
chocolateyVersion: 0.10.15
chocolateyVersion: 0.11.3
- name: chef_infra_latest
run_list:
- recipe[chocolatey::default]
attributes:
chocolatey:
install_vars:
chocolateyVersion: 0.10.15
chocolateyVersion: 0.11.3
20 changes: 0 additions & 20 deletions test/integration/chef_12/default_spec.rb

This file was deleted.

16 changes: 16 additions & 0 deletions test/integration/chef_infra_12/default_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
describe command('C:\ProgramData\chocolatey\bin\chocolatey.exe') do
its('stdout') { should match(/Chocolatey/) }
end

describe command('C:\ProgramData\chocolatey\bin\chocolatey.exe --version') do
its('stdout.strip') { should cmp '0.11.3' }
end

describe file('C:\ProgramData\chocolatey\lib\chocolatey\chocolatey.nupkg') do
it { should exist }
end

describe chocolatey_package('chocolatey') do
it { should be_installed }
its('version') { should eq '0.11.3' }
end
16 changes: 16 additions & 0 deletions test/integration/chef_infra_latest/default_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
describe command('C:\ProgramData\chocolatey\bin\chocolatey.exe') do
its('stdout') { should match(/Chocolatey/) }
end

describe command('C:\ProgramData\chocolatey\bin\chocolatey.exe --version') do
its('stdout.strip') { should cmp '0.11.3' }
end

describe file('C:\ProgramData\chocolatey\lib\chocolatey\chocolatey.nupkg') do
it { should exist }
end

describe chocolatey_package('chocolatey') do
it { should be_installed }
its('version') { should eq '0.11.3' }
end
20 changes: 0 additions & 20 deletions test/integration/chef_latest/default_spec.rb

This file was deleted.