diff --git a/.github/workflows/branchcleanup.yml b/.github/workflows/branchcleanup.yml deleted file mode 100644 index f3f61ff..0000000 --- a/.github/workflows/branchcleanup.yml +++ /dev/null @@ -1,17 +0,0 @@ ---- -name: Branch Cleanup -# This workflow is triggered on all closed pull requests. -# However the script does not do anything if a merge was not performed. -"on": - pull_request: - types: [closed] - -env: - NO_BRANCH_DELETED_EXIT_CODE: 0 - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: jessfraz/branch-cleanup-action@master diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..a3b0087 --- /dev/null +++ b/.github/workflows/ci.yml @@ -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 diff --git a/.github/workflows/delivery.yml b/.github/workflows/delivery.yml deleted file mode 100644 index 628af88..0000000 --- a/.github/workflows/delivery.yml +++ /dev/null @@ -1,16 +0,0 @@ -name: delivery - -on: [push, pull_request] - -jobs: - delivery: - - runs-on: ubuntu-latest - - steps: - - name: Check out code - uses: actions/checkout@master - - name: Run Chef Delivery - uses: actionshub/chef-delivery@main - env: - CHEF_LICENSE: accept-no-persist diff --git a/.mdlrc b/.mdlrc new file mode 100644 index 0000000..9cc2c63 --- /dev/null +++ b/.mdlrc @@ -0,0 +1 @@ +rules "~MD013", "~MD024", "~MD025" diff --git a/CHANGELOG.md b/CHANGELOG.md index dbe96eb..f3436f1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) diff --git a/README.md b/README.md index cd90a43..7a1024d 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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:
+- `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 [ @@ -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 ([mathie@woss.name](mailto:mathie@woss.name)) +Thank you to all our backers! -Author:: Joshua Timberman ([joshua@chef.io](mailto:joshua@chef.io)) +![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. +### 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) diff --git a/kitchen.exec.yml b/kitchen.exec.yml new file mode 100644 index 0000000..603cbf2 --- /dev/null +++ b/kitchen.exec.yml @@ -0,0 +1,13 @@ +--- +driver: + name: exec + +transport: + name: exec + +provisioner: + name: chef_zero + deprecations_as_errors: true + +platforms: + - name: macos-latest diff --git a/kitchen.yml b/kitchen.yml index 107a844..38505f4 100644 --- a/kitchen.yml +++ b/kitchen.yml @@ -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 diff --git a/test/cookbooks/test/recipes/default.rb b/test/cookbooks/test/recipes/default.rb index d001585..ee6b950 100644 --- a/test/cookbooks/test/recipes/default.rb +++ b/test/cookbooks/test/recipes/default.rb @@ -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'] = [ { @@ -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 diff --git a/test/integration/default/default_spec.rb b/test/integration/default/default_spec.rb index 001681d..8ec9587 100644 --- a/test/integration/default/default_spec.rb +++ b/test/integration/default/default_spec.rb @@ -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