Coder Social home page Coder Social logo

sprout-homebrew's Introduction

sprout-homebrew cookbook

Build Status

A Chef cookbook to manage automatic startup of homebrew formulas.

Deprecation Notice

sprout-homebrew is mostly deprecated in favor of Chef's default homebrew cookbook, and is only useful for managing package automatic startup with launchctl. If you need to install homebrew, formulas, or casks, please use that cookbook instead. If needed, sprout-homebrew 0.3.0 is available, but keep in mind that it may not work as expected.

To migrate from sprout-homebrew to homebrew, you can do the following:

  • sprout-homebrew::formulae — Use homebrew::install_formulas and move node_attributes.sprout.homebrew.formulae to node_attributes.homebrew.formulas.
  • sprout-homebrew::casks — Use homebrew::install_casks and move node_attributes.sprout.homebrew.casks to node_attributes.homebrew.casks.

Usage

Prerequisites

Quickstart

bundle
bundle exec soloist

Cookbook Usage

Attributes

NOTE: All preferences are namespaced under sprout => homebrew they include:

  • launchctl — The list of packages to automatically start (managed by launchctl). Each package is a key value e.g. tor: load where the value is one of:
    • load — Start the package at system start, and launch immediately
    • unload — Do not start the package at system start, and stop if currently running
    • reload — Reload a package already set to start at system start

Recipes

  1. sprout-homebrew::launchctl

Contributing

Before committing

bundle
bundle exec rake

The default rake task includes rubocop, foodcritic, unit specs

bundle
bundle exec rake rubocop
bundle
bundle exec rake foodcritic

Unit specs

Unit specs use ServerSpec

bundle
bundle exec rake spec:unit

Integration specs

Integrations specs will run the default recipe on the host system (destructive) and make assertions on the system after install.

bundle
bundle exec rake spec:integration

sprout-homebrew's People

Contributors

cbguder avatar codeword avatar hiremaga avatar lukegary avatar msmykowski avatar scottmuc avatar wendorf avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

sprout-homebrew's Issues

`no implicit conversion of nil into String` error when running soloist

We're calling this cookbook from sprout wrap on El Capitan pairing stations, and getting the following error - we are continuing to investigate as we have time but we don't yet know what's going on. Relevant error output:

Recipe: sprout-homebrew::cask
  * directory[/usr/local/Library/Taps] action create[2016-01-19T11:15:26+01:00] INFO: Processing directory[/usr/local/Library/Taps] action create (sprout-homebrew::cask line 3)
 (up to date)
  * execute[tap cask] action run[2016-01-19T11:15:26+01:00] INFO: Processing execute[tap cask] action run (sprout-homebrew::cask line 8)
Warning: Tap caskroom/cask already tapped.
[2016-01-19T11:15:27+01:00] INFO: execute[tap cask] ran successfully

    - execute brew tap "caskroom/homebrew-cask"
  * homebrew_package[caskroom/cask/brew-cask] action install[2016-01-19T11:15:27+01:00] INFO: Processing homebrew_package[caskroom/cask/brew-cask] action install (sprout-homebrew::cask line 13)


    ================================================================================
    Error executing action `install` on resource 'homebrew_package[caskroom/cask/brew-cask]'
    ================================================================================

    TypeError
    ---------
    no implicit conversion of nil into String

    Cookbook Trace:
    ---------------
    /Users/smartb/sprout-wrap/cookbooks/homebrew/libraries/homebrew_package.rb:94:in `get_version_from_formula'
    /Users/smartb/sprout-wrap/cookbooks/homebrew/libraries/homebrew_package.rb:74:in `current_installed_version'
    /Users/smartb/sprout-wrap/cookbooks/homebrew/libraries/homebrew_package.rb:44:in `load_current_resource'

    Resource Declaration:
    ---------------------
    # In /Users/smartb/sprout-wrap/cookbooks/sprout-homebrew/recipes/cask.rb

     13: package 'caskroom/cask/brew-cask'
     14:

    Compiled Resource:
    ------------------
    # Declared in /Users/smartb/sprout-wrap/cookbooks/sprout-homebrew/recipes/cask.rb:13:in `from_file'

    homebrew_package("caskroom/cask/brew-cask") do
      action [:install]
      retries 0
      retry_delay 2
      default_guard_interpreter :default
      package_name "caskroom/cask/brew-cask"
      declared_type :package
      cookbook_name :"sprout-homebrew"
      recipe_name "cask"
    end

[2016-01-19T11:15:27+01:00] INFO: Running queued delayed notifications before re-raising exception

Running handlers:
[2016-01-19T11:15:27+01:00] ERROR: Running exception handlers
Running handlers complete
[2016-01-19T11:15:27+01:00] ERROR: Exception handlers complete
Chef Client failed. 12 resources updated in 36.638406 seconds
[2016-01-19T11:15:27+01:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
[2016-01-19T11:15:27+01:00] ERROR: homebrew_package[caskroom/cask/brew-cask] (sprout-homebrew::cask line 13) had an error: TypeError: no implicit conversion of nil into String
[2016-01-19T11:15:27+01:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)

/cc @bixu @arochaf

Allow custom taps

I really want to install cloudfoundry-cli via sprout-homebrew but it's under a custom tap pivotal/homebrew-tap.

Is there a way to specify custom taps? If not, there should be.

/opt is not readable by "other" after first run.

After fresh install:

○ → cd /opt
-bash: cd: /opt: Permission denied

My current fix:

sudo chmod -R o+rx /opt

Then everything is groovy.

 |2.1.0| wanelos-iMac-2 in /
○ → cd opt

 |2.1.0| wanelos-iMac-2 in /opt
○ → ls -la

Anyone else having this problem?

I'm still getting the wrong version of the homebrew install script

It looks like work has been done to update the home-brew install script to point to go/install instead of just go. For some reason, even though all of the proper git references are in place – it doesn't seem to be taking on the new recipes.

I've run a be librarian-chef update on all my cookbooks, so we should be up to date.

Any idea what could be wrong here?

±  |master ✓| → be soloist
Recipe: homebrew::default
  * remote_file[/var/chef/cache/homebrew_go] action create[2013-12-04T10:07:19-08:00] INFO: Processing remote_file[/var/chef/cache/homebrew_go] action create (homebrew::default line 29)
[2013-12-04T10:07:20-08:00] INFO: remote_file[/var/chef/cache/homebrew_go] backed up to /var/chef/backup/var/chef/cache/homebrew_go.chef-20131204100720
[2013-12-04T10:07:20-08:00] INFO: remote_file[/var/chef/cache/homebrew_go] removed backup at /var/chef/backup/./var/chef/cache/homebrew_go.chef-20131204020905
[2013-12-04T10:07:20-08:00] INFO: remote_file[/var/chef/cache/homebrew_go] updated

    - copy file downloaded from [] into /var/chef/cache/homebrew_go
        --- /var/chef/cache/homebrew_go 2013-12-04 09:54:08.000000000 -0800
        +++ /var/folders/g5/c_pbg9052jbc9721pnx_wmdh0000gn/T/chef-rest20131204-51896-pb3lcw 2013-12-04 10:07:20.000000000 -0800
        @@ -15,7 +15,7 @@
             <link rel="apple-touch-icon" sizes="144x144" href="/apple-touch-icon-144.png" />
             <link rel="logo" type="image/svg" href="https://github-media-downloads.s3.amazonaws.com/github-logo.svg" />
             <meta property="og:image" content="https://github.global.ssl.fastly.net/images/modules/logos_page/Octocat.png">
        -    <meta name="hostname" content="github-fe128-cp1-prd.iad.github.net">
        +    <meta name="hostname" content="github-fe124-cp1-prd.iad.github.net">
             <meta name="ruby" content="ruby 1.9.3p194-tcs-github-tcmalloc (e1c0c3f392) [x86_64-linux]">
  * execute[/var/chef/cache/homebrew_go] action run[2013-12-04T10:07:20-08:00] INFO: Processing execute[/var/chef/cache/homebrew_go] action run (homebrew::default line 34)
 (skipped due to not_if)
  * package[git] action install[2013-12-04T10:07:20-08:00] INFO: Processing package[git] action install (homebrew::default line 39)
 (skipped due to not_if)
  * execute[update homebrew from github] action run[2013-12-04T10:07:20-08:00] INFO: Processing execute[update homebrew from github] action run (homebrew::default line 43)

etc.... really long diff...

  * execute[/var/chef/cache/homebrew_go] action run[2013-12-04T10:07:20-08:00] INFO: Processing execute[/var/chef/cache/homebrew_go] action run (homebrew::default line 34)
 (skipped due to not_if)
  * package[git] action install[2013-12-04T10:07:20-08:00] INFO: Processing package[git] action install (homebrew::default line 39)
 (skipped due to not_if)
  * execute[update homebrew from github] action run[2013-12-04T10:07:20-08:00] INFO: Processing execute[update homebrew from github] action run (homebrew::default line 43)
Updated Homebrew from a31f91be to aee75f18.

Install HEAD versions of a formula

I want to be able to do brew install --HEAD hub. Since the formulae is a list of scalar yaml nodes it would be a big change to make it a list of hashes. Would a specialized syntax work (eg: hub@HEAD).

I tried adding --HEAD hub as a formula in my soloistrc file, but the result was:

  * package[--HEAD hub] action install[2014-11-30T13:57:10+05:30] INFO: Processing package[--HEAD hub] action install (sprout-homebrew::formulae line 7)

================================================================================
Error executing action `install` on resource 'package[--HEAD hub]'
================================================================================


FormulaUnavailableError
-----------------------
No available formula for --HEAD hub 


Cookbook Trace:
---------------
/Users/smuc/workstation/cookbooks/homebrew/libraries/homebrew_package.rb:92:in `get_version_from_formula'
/Users/smuc/workstation/cookbooks/homebrew/libraries/homebrew_package.rb:69:in `current_installed_version'
/Users/smuc/workstation/cookbooks/homebrew/libraries/homebrew_package.rb:39:in `load_current_resource'


Resource Declaration:
---------------------
# In /Users/smuc/workstation/cookbooks/sprout-homebrew/recipes/formulae.rb

  7:   package formula
  8: end



Compiled Resource:
------------------
# Declared in /Users/smuc/workstation/cookbooks/sprout-homebrew/recipes/formulae.rb:7:in `block in from_file'

package("--HEAD hub") do
  action :install
  retries 0
  retry_delay 2
  package_name "--HEAD hub"
  cookbook_name :"sprout-homebrew"
  recipe_name "formulae"
end

Error: Tap caskroom/cask already tapped.

This is found on a fresh Mac OS Yosemite. When sprout-wrap('bundle exec soloist') failed due to some problems, and I fixed it and ran it again, I got the error below. I have to "brew untap caskroom/cask" every time to continue.

Recipe: sprout-homebrew::casks

  • sprout_homebrew_cask[chefdk] action install[2015-11-10T14:49:14+08:00] INFO: Processing sprout_homebrew_cask[chefdk] action install (sprout-homebrew::casks line 7)

Recipe: sprout-homebrew::cask

  • directory[/usr/local/Library/Taps] action create[2015-11-10T14:49:14+08:00] INFO: Processing directory[/usr/local/Library/Taps] action create (sprout-homebrew::cask line 3)

    (up to date)

  • execute[tap cask] action run[2015-11-10T14:49:14+08:00] INFO: Processing execute[tap cask] action run (sprout-homebrew::cask line 8)

Error: Tap caskroom/cask already tapped.

Remove recipes that are covered by chef-cookbooks/homebrew

chef-cookbooks/homebrew does most of what this cookbook intends to do, and is more "canonical". If this PR is accepted, then the only novel functionality our cookbook provides is the launchctl recipe.

We should consider deprecating or removing most of this cookbook, and maybe moving the launchctl recipe somewhere else.

@hiremaga Thoughts?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.