Skip to content
This repository has been archived by the owner on Apr 21, 2020. It is now read-only.
/ laptop Public archive
forked from thoughtbot/laptop

A shell script which turns your OS X laptop into an awesome web development machine.

License

Notifications You must be signed in to change notification settings

omadahealth/laptop

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Laptop

Laptop is a script to set up an OS X laptop for web development.

It can be run multiple times on the same machine safely. It installs, upgrades, or skips packages based on what is already installed on the machine.

Pre-installation steps

This script assumes you have gone through the steps outlined in the engineering onboarding wiki and have set up your Github profile with your ssh keys before running.

You will need sudo permissions to run this script.

Install

Download, review, then execute the script:

curl -o ~/mac --remote-name https://raw.githubusercontent.com/omadahealth/laptop/master/mac
less ~/mac
sh ~/mac 2>&1 | tee ~/laptop.log

Once the script is done, it's a good idea to quit and relaunch Terminal.

If you want project specific or other customizations (more info in further sections), there's an example .laptop.local file here:

curl -o ~/.laptop.local --remote-name https://raw.githubusercontent.com/omadahealth/laptop/master/.laptop.local

If you download it, it will be run when you run the regular mac script.

Debugging

Your last Laptop run will be saved to ~/laptop.log. Read through it to see if you can debug the issue yourself. If not, copy the lines where the script failed into a new GitHub Issue for us. Or, attach the whole log file as an attachment.

What it sets up

Mac OS X tools:

  • Homebrew for managing operating system libraries.

Dotfiles:

Unix tools:

  • Git for version control
  • OpenSSL for Transport Layer Security (TLS)
  • Coreutils provides the GNU version of the stat command

Image tools:

Programming languages and configuration:

  • [Bundler] for managing Ruby libraries
  • [Node.js] and [NPM], for running apps and installing JavaScript packages
  • [RVM] for managing versions of Ruby
  • [Ruby] stable for writing general-purpose code

Databases:

  • Postgres for storing relational data
  • Redis for storing key-value data

It should take less than 15 minutes to install (depends on your machine).

Customize your team's setup in the project specific files

There are project specific files in the /projects folder.

If you want to share setup commands between your whole team, add them in there and create a pull request to update them in the repo.

The team files are pulled in when running the laptop.local script.

You can declare which teams' files you'd like to include by updating this line: declare -a PROJECTS=("orange" "green" "blue" "red")

When naming new team files, please keep to the style of teamname.local.

Customize in ~/.laptop.local

Your ~/.laptop.local is run at the end of the mac script. Put your personal customizations there. This repo already contains a .laptop.local you can use to get started. Either grab it from the repo or you can download it to your home directory using the command below.

curl -o ~/.laptop.local --remote-name https://raw.githubusercontent.com/omadahealth/laptop/master/.laptop.local

Optional tools currently in laptop.local If you want to install these, uncomment them from the laptop.local file.

  • Qt for headless JavaScript testing via Capybara Webkit
  • PhantomJS for JavaScript testing
  • Watchman watches files and records, or triggers actions, when they change
  • GPG for management of PGP keys

For example:

#!/bin/sh

brew_cask_install_or_upgrade "dockertoolbox"
brew_install_or_upgrade "go"
brew_install_or_upgrade "ngrok"
brew_install_or_upgrade "watch"

default_docker_machine() {
  docker-machine ls | grep -Fq "default"
}

if ! default_docker_machine; then
  docker-machine create --driver virtualbox default
fi

default_docker_machine_running() {
  default_docker_machine | grep -Fq "Running"
}

if ! default_docker_machine_running; then
  docker-machine start default
fi

fancy_echo "Cleaning up old Homebrew formulae ..."
brew cleanup
brew cask cleanup

if [ -r "$HOME/.rcrc" ]; then
  fancy_echo "Updating dotfiles ..."
  rcup
fi

Write your customizations such that they can be run safely more than once. See the mac script for examples.

Laptop functions such as fancy_echo and gem_install_or_update can be used in your ~/.laptop.local.

See the wiki for more customization examples.

Contributing

Edit the mac file. Document in the README.md file. Follow shell style guidelines by using ShellCheck.

brew install shellcheck

License

Laptop is © 2011-2016 thoughtbot, inc. It is free software, and may be redistributed under the terms specified in the LICENSE file.

About

A shell script which turns your OS X laptop into an awesome web development machine.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 100.0%