GithubHelp home page GithubHelp logo

wendorf / homebrew-bundle Goto Github PK

View Code? Open in Web Editor NEW

This project forked from homebrew/homebrew-bundle

0.0 3.0 0.0 367 KB

:package: Bundler for non-Ruby dependencies from Homebrew

License: MIT License

Ruby 100.00%

homebrew-bundle's Introduction

Homebrew Bundle

Bundler for non-Ruby dependencies from Homebrew

Coverage Status Build Status

Requirements

Homebrew or Linuxbrew are used for installing the dependencies. Linuxbrew is a fork of Homebrew for Linux, while Homebrew only works on macOS. This tool is primarily developed for use with Homebrew on macOS but should work with Linuxbrew on Linux, too.

Homebrew Cask is optional and used for installing Mac applications.

mas-cli is optional and used for installing Mac App Store applications.

Install

You can install as a Homebrew tap:

$ brew tap Homebrew/bundle

Usage

Create a Brewfile in the root of your project:

$ touch Brewfile

Then list your Homebrew based dependencies in your Brewfile:

cask_args appdir: "/Applications"
tap "caskroom/cask"
tap "telemachus/brew", "https://[email protected]/telemachus/brew.git"
brew "imagemagick"
brew "mysql", restart_service: true, conflicts_with: ["homebrew/versions/mysql56"]
brew "emacs", args: ["with-cocoa", "with-gnutls"]
cask "google-chrome"
cask "java" unless system "/usr/libexec/java_home --failfast"
cask "firefox", args: { appdir: "~/my-apps/Applications" }
mas "1Password", id: 443987910

You can then easily install all of the dependencies with the following command:

$ brew bundle

If a dependency is already installed and there is an update available it will be upgraded.

Dump

You can create a Brewfile from all the existing Homebrew packages you have installed with:

$ brew bundle dump

The --force option will allow an existing Brewfile to be overwritten as well.

Cleanup

You can also use Brewfile as a whitelist. It's useful for maintainers/testers who regularly install lots of formulae. To uninstall all Homebrew formulae not listed in Brewfile:

$ brew bundle cleanup

Unless the --force option is passed, formulae will be listed rather than actually uninstalled.

Check

You can check there's anything to install/upgrade in the Brewfile by running:

$ brew bundle check

This provides a successful exit code if everything is up-to-date so is useful for scripting.

Exec

Runs an external command within Homebrew's superenv build environment:

$ brew bundle exec -- bundle install

This sanitized build environment ignores unrequested dependencies, which makes sure that things you didn't specify in your Brewfile won't get picked up by commands like bundle install, npm install, etc. It will also add compiler flags which will help find keg-only dependencies like openssl, icu4c, etc.

Restarting services

You can choose whether brew bundle restarts a service every time it's run, or only when the formula is installed or upgraded in your Brewfile:

# Always restart myservice
brew 'myservice', restart_service: true

# Only restart when installing or upgrading myservice
brew 'myservice', restart_service: :changed

Note

Homebrew does not support installing specific versions of a library, only the most recent one, so there is no good mechanism for storing installed versions in a .lock file.

If your software needs specific versions then perhaps you'll want to look at using Vagrant to better match your development and production environments.

Tests

Tests can be run with bundle && bundle exec rake spec

Copyright

Copyright (c) 2015 Homebrew maintainers and Andrew Nesbitt. See LICENSE for details.

homebrew-bundle's People

Contributors

mikemcquaid avatar xu-cheng avatar andrew avatar jamesaanderson avatar rprimus avatar pvdb avatar teoljungberg avatar adamliter avatar josephfrazier avatar mistydemeo avatar brunophilipe avatar seiji avatar josh avatar ffittschen avatar aheckler avatar ktheory avatar ilovezfs avatar buddhamagnet avatar vitorgalvao avatar timurvafin avatar sjackman avatar alyssais avatar dlackty avatar onemanstartup avatar schlick avatar maxfierke avatar liquidsoul avatar cheungpat avatar denkristoffer avatar jfrux avatar

Watchers

Dan Wendorf avatar James Cloos avatar  avatar

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.