GithubHelp home page GithubHelp logo

connorshea / bootstrapper Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 21 KB

Configurable Ruby script to set up a Mac with various useful development tools

License: MIT License

Ruby 100.00%
laptop development-environment macos ruby bootstrapper homebrew setup setup-macos

bootstrapper's Introduction

Bootstrapper

NOTE: This script been tested (without problems on a new 2018 MacBook Pro running Mojave), but not extensively. Mojave is the only version I've tested it on, past/future versions may work but there are no guarantees.

The goal of this Ruby script is to take a simple YAML configuration file and set up all the utilities one may need.

The idea comes from thoughtbot's laptop script, which I wanted to make more configurable.

Usage

  1. Open the Terminal.
  2. Try to run git help, if the Xcode Command Line Tools aren't installed the command will fail and give you a dialog which will allow you to easily install the command line tools. Otherwise it'll just show some help info.
  3. Move to a directory you'd like to clone this git repository into.
  4. git clone https://github.com/connorshea/bootstrapper.git: Clone this repository with git.
  5. cd bootstrapper: Move to the bootstrapper directory you just created.
  6. Configure your bootstrapper.yml file (more info in the bootstrapper.yml section below.)
  7. ruby bootstrapper.rb: You should not run this script as sudo. It has certain commands that must be run with sudo, and will therefore request your password, but the script itself shouldn't require sudo.
    • TIP: You should pipe the script's output into tee, like so: ruby bootstrapper.rb | tee output.txt, this will make the script output both to the Terminal and to a separate file called output.txt. This allows the user to refer back to the outputs of the installation script later, as needed (e.g. certain brew formula may need special handling to work properly for certain use cases, and print instructions to stdout when they're installed).

The script will have a few inputs for you to respond to, such as your git username and email.

bootstrapper.yml

The bootstrapper.yml file is used to configure the Bootstrapper script. It can be modified to install certain dependencies, run arbitrary commands, etc.

Examples

This is an example of how a bootstrapper.yml file looks:

bootstrapper:
  # Configure what the script should set up for you.
  # Most of these are just installed from Homebrew.
  config:
    # homebrew can't actually be set to false or everything else will break, sorry!
    homebrew: true
    ruby: true
    postgres: true
    mysql: true
    git: true
    rbenv: true
    vim: true
  # Open these URLs before doing anything else.
  # This is so you can install applications like a text editor, browser, etc.
  # while you wait for brew to install everything.
  open_urls:
    # VS Code
    - 'https://code.visualstudio.com'
  # Homebrew packages that should be installed, this is for installing things
  # the script doesn't already support.
  # Leave this empty if you don't want to install any of it.
  brew_install:
    - 'cowsay'
    - 'tree'
  # Arbitrary commands to run after setting up the script. Be careful with this!
  after_script:
    - 'cowsay test'
    - 'tree .'

You can opt to not install any extra packages or run any extra bash commands by leaving those sections empty:

bootstrapper:
  # Configure what the script should set up for you.
  # Most of these are just installed from Homebrew.
  config:
    # homebrew can't actually be set to false or everything else will break, sorry!
    homebrew: true
    postgres: true
    mysql: false
    git: false
    rbenv: false
    vim: false
  # Open these URLs before doing anything else.
  # This is so you can install applications like a text editor, browser, etc.
  # while you wait for brew to install everything.
  open_urls:
  # Homebrew packages that should be installed, this is for installing things
  # the script doesn't already support.
  # Leave this empty if you don't want to install any of it.
  brew_install:
  # Arbitrary commands to run after setting up the script. Be careful with this!
  # Leave this empty if you don't want to run any extra commands.
  after_script:

See examples/ for more example YAML files.

bootstrapper's People

Contributors

connorshea avatar

Stargazers

 avatar

Watchers

 avatar  avatar

bootstrapper's Issues

Come up with a better name

bootstrapper kind of sucks, and also it's already taken by another Ruby gem.

Soliciting suggestions if anyone has any :D

Log to a file

Add the ability to log the output of the script to a file as well as STDOUT.

Investigate automated testing

I'm admittedly not sure how this should work, given that I don't just have spare Macs lying around to test with.

Travis CI supports testing on macOS but I assume it won't work quite like an actual MacBook, which makes testing harder.

(How does Homebrew do it?)

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.