Skip to content

Commit

Permalink
Sous Chefs Adoption
Browse files Browse the repository at this point in the history
Signed-off-by: Lance Albertson <[email protected]>
  • Loading branch information
ramereth committed Jan 23, 2021
1 parent 7f83db6 commit 98678da
Show file tree
Hide file tree
Showing 10 changed files with 119 additions and 76 deletions.
17 changes: 0 additions & 17 deletions .github/workflows/branchcleanup.yml

This file was deleted.

67 changes: 67 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
---
name: ci

"on":
pull_request:
push:
branches:
- master

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

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

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

macos-latest:
needs: [mdl, yamllint, delivery]
runs-on: macos-latest
strategy:
matrix:
os:
- macos-latest
suite:
- 'default'
fail-fast: false

steps:
- name: Check out code
uses: actions/checkout@master
- name: Install Chef
uses: actionshub/chef-install@master
- name: test-kitchen
uses: actionshub/test-kitchen@master
env:
CHEF_LICENSE: accept-no-persist
KITCHEN_LOCAL_YAML: kitchen.exec.yml
with:
suite: ${{ matrix.suite }}
os: ${{ matrix.os }}

final:
needs: [macos-latest]
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@master
16 changes: 0 additions & 16 deletions .github/workflows/delivery.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", "~MD025"
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

This file is used to list changes made in each version of the homebrew cookbook.

## Unreleased

- Sous Chefs Adoption
- Standardise files with files in sous-chefs/repo-management

## 5.1.1 (2021-01-04)

- Update to use --cask instead of cask command for compatibility with newer homebrew releases- [@tas50](https://github.com/tas50)
Expand Down
50 changes: 28 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
# Homebrew Cookbook

![delivery](https://github.com/chef-cookbooks/homebrew/workflows/delivery/badge.svg) [![Cookbook Version](https://img.shields.io/cookbook/v/homebrew.svg)](https://supermarket.chef.io/cookbooks/homebrew)
[![Cookbook Version](https://img.shields.io/cookbook/v/homebrew.svg)](https://supermarket.chef.io/cookbooks/homebrew)
[![CI State](https://github.com/sous-chefs/homebrew/workflows/ci/badge.svg)](https://github.com/sous-chefs/homebrew/actions?query=workflow%3Aci)
[![OpenCollective](https://opencollective.com/sous-chefs/backers/badge.svg)](#backers)
[![OpenCollective](https://opencollective.com/sous-chefs/sponsors/badge.svg)](#sponsors)
[![License](https://img.shields.io/badge/License-Apache%202.0-green.svg)](https://opensource.org/licenses/Apache-2.0)

This cookbook installs [Homebrew](http://brew.sh/) and provides resources for working with taps and casks

Note: The homebrew_tap and homebrew_cask resources shipped in Chef 14.0. When Chef 15.0 is released in April 2019 these resources will be removed from this cookbook as all users should be on 14.0 or later.
Note: The `homebrew_tap` and `homebrew_cask` resources shipped in Chef 14.0. When Chef 15.0 is released in April 2019 these resources will be removed from this cookbook as all users should be on 14.0 or later.

## Maintainers

This cookbook is maintained by the Sous Chefs. The Sous Chefs are a community of Chef cookbook maintainers working together to maintain important cookbooks. If you’d like to know more please visit [sous-chefs.org](https://sous-chefs.org/) or come chat with us on the Chef Community Slack in [#sous-chefs](https://chefcommunity.slack.com/messages/C2V7B88SF).

## Requirements

Expand Down Expand Up @@ -139,7 +147,7 @@ end
- `node['homebrew']['casks']` - An Array of casks that should be installed using brew cask by default, used only in the `homebrew::install_casks` recipe.
- `node['homebrew']['taps']` - An Array of taps that should be installed using brew tap by default, used only in the `homebrew::install_taps` recipe. For example:<br>
- `node['homebrew']['taps']` - An Array of taps that should be installed using brew tap by default, used only in the `homebrew::install_taps` recipe. For example:
```ruby
[
Expand All @@ -155,29 +163,27 @@ We strongly recommend that you put "recipe[homebrew]" in your node's run list, t

The default recipe also ensures that Homebrew is installed and up to date if the auto-update attribute (above) is true (default).

## License and Authors
## Contributors

This cookbook is maintained by CHEF. The original author, maintainer and copyright holder is Graeme Mathieson. The cookbook remains licensed under the Apache License version 2.
This project exists thanks to all the people who [contribute.](https://opencollective.com/sous-chefs/contributors.svg?width=890&button=false)

[Original blog post by Graeme](https://woss.name/articles/converging-your-home-directory-with-chef/)
### Backers

Author:: Graeme Mathieson ([[email protected]](mailto:[email protected]))
Thank you to all our backers!

Author:: Joshua Timberman ([[email protected]](mailto:[email protected]))
![https://opencollective.com/sous-chefs#backers](https://opencollective.com/sous-chefs/backers.svg?width=600&avatarHeight=40)

```text
Copyright:: 2011, Graeme Mathieson
Copyright:: 2012-2021, Chef Software, Inc. <[email protected]>
### Sponsors

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
Support this project by becoming a sponsor. Your logo will show up here with a link to your website.

http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
```
![https://opencollective.com/sous-chefs/sponsor/0/website](https://opencollective.com/sous-chefs/sponsor/0/avatar.svg?avatarHeight=100)
![https://opencollective.com/sous-chefs/sponsor/1/website](https://opencollective.com/sous-chefs/sponsor/1/avatar.svg?avatarHeight=100)
![https://opencollective.com/sous-chefs/sponsor/2/website](https://opencollective.com/sous-chefs/sponsor/2/avatar.svg?avatarHeight=100)
![https://opencollective.com/sous-chefs/sponsor/3/website](https://opencollective.com/sous-chefs/sponsor/3/avatar.svg?avatarHeight=100)
![https://opencollective.com/sous-chefs/sponsor/4/website](https://opencollective.com/sous-chefs/sponsor/4/avatar.svg?avatarHeight=100)
![https://opencollective.com/sous-chefs/sponsor/5/website](https://opencollective.com/sous-chefs/sponsor/5/avatar.svg?avatarHeight=100)
![https://opencollective.com/sous-chefs/sponsor/6/website](https://opencollective.com/sous-chefs/sponsor/6/avatar.svg?avatarHeight=100)
![https://opencollective.com/sous-chefs/sponsor/7/website](https://opencollective.com/sous-chefs/sponsor/7/avatar.svg?avatarHeight=100)
![https://opencollective.com/sous-chefs/sponsor/8/website](https://opencollective.com/sous-chefs/sponsor/8/avatar.svg?avatarHeight=100)
![https://opencollective.com/sous-chefs/sponsor/9/website](https://opencollective.com/sous-chefs/sponsor/9/avatar.svg?avatarHeight=100)
13 changes: 13 additions & 0 deletions kitchen.exec.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
driver:
name: exec

transport:
name: exec

provisioner:
name: chef_zero
deprecations_as_errors: true

platforms:
- name: macos-latest
2 changes: 1 addition & 1 deletion kitchen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ verifier:
platforms:
- name: macos-10.12
driver:
box: chef/macos-10.12 # private box in Chef's Atlas account
box: chef/macos-10.12 # private box in Chef's Atlas account

suites:
- name: default
Expand Down
6 changes: 1 addition & 5 deletions test/cookbooks/test/recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
# Copyright:: 2016-2019, Chef Software, Inc.

node.default['homebrew']['formulas'] = %w(redis)
node.default['homebrew']['formulas'] = %w(redis jq)
node.default['homebrew']['casks'] = %w(caffeine)
node.default['homebrew']['taps'] = [
{
Expand All @@ -16,10 +16,6 @@
'url' => 'https://github.com/homebrew/homebrew-services.git',
'full' => true,
},
{ 'tap' => 'homebrew/php',
'url' => 'https://github.com/homebrew/homebrew-php.git',
'full' => false,
},
]
node.default['homebrew']['enable-analytics'] = false

Expand Down
18 changes: 3 additions & 15 deletions test/integration/default/default_spec.rb
Original file line number Diff line number Diff line change
@@ -1,21 +1,9 @@
describe command('sudo -u vagrant /usr/local/bin/brew info redis --json=v1') do
# the JSON output is awkward to parse here, but it's
# cross-platform-version, since the formula may be installed as a
# source or from bottle depending on the version of OS X.
its(:stdout) { should match('"installed":\[{"version":') }
describe command('brew info redis --json=v1 | jq ".[].installed[0].installed_on_request"') do
its('stdout') { should match('true') }
end

describe file('/usr/local/Caskroom/caffeine') do
it { should be_directory }
its('mode') { should cmp '0755' }
it { should be_owned_by 'vagrant' }
end

describe file('/usr/local/Homebrew/Library/Taps/homebrew/homebrew-php/.git') do
it { should be_directory }
it { should be_owned_by 'vagrant' }
end

describe command('sudo -u vagrant bash -c \'REPO=$(brew --repo homebrew/bundle); [ -f "${REPO}/$(git -C "${REPO}" rev-parse --git-dir)/shallow" ] && echo true || echo false\'') do
its(:stdout) { should match('false') }
it { should be_owned_by 'runner' }
end

0 comments on commit 98678da

Please sign in to comment.