Skip to content

carousell/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 macOS laptop for development at Carousell. This is a fork of thoughtbot's laptop project with local customization for Carousell's environment. It is less opinioniated and can be customized to support platform defaults (eg. Android Studio for software engineers working on the Android platform).

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.

Requirements

We support:

  • macOS Sierra (10.12)
  • macOS High Sierra (10.13)
  • macOS Mojave (10.14)

Older versions may work but aren't regularly tested. Bug reports for older versions are welcome.

Install

Step 1: Common Engineering Setup

Run this first, regardless of the platform you work on.

sh mac -dev 2>&1 | tee ~/laptop.log

Step 2: Platform Specific Setup

For Android Development

Once you have done the Common Engineering setup above, run the following to install Android Studio and other dependencies.

sh mac -android 2>&1 | tee ~/laptop.log

For iOS Development

Once you have done the Common Engineering setup above, run the following to install Android Studio and other dependencies.

sh mac -ios 2>&1 | tee ~/laptop.log

For Backend Development

Once you have done the Common Engineering setup above, run the following to install Docker, Golang and other dependencies.

sh mac -backend 2>&1 | tee ~/laptop.log

For Web Development

Once you have done the Common Engineering setup above, run the following to install Docker, Node and other dependencies.

sh mac -web 2>&1 | tee ~/laptop.log

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

General Install for Everyone:

  • Homebrew for managing operating system libraries.

Apps:

Engineering Setup

Unix tools:

  • Git for version control
  • OpenSSL for Transport Layer Security (TLS)
  • Tmux for saving project state and switching between projects

Programming languages and configuration:

  • Node.js and NPM, for running apps and installing JavaScript packages
  • Rbenv for managing versions of Ruby
  • Ruby Build for installing Rubies
  • Ruby stable for writing general-purpose code
  • Java
  • Python for most of our tools

Android specific:

iOS Specific:

It should take less than 30 minutes to install (depends on your machine), and will be longer for mobile development setup.

Customize in ~/.laptop.local

Your ~/.laptop.local is run at the end of the Laptop script. Put your customizations there. For example:

#!/bin/sh

brew bundle --file=- <<EOF
brew "Caskroom/cask/dockertoolbox"
brew "go"
brew "ngrok"
brew "watch"
EOF

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 and Syntastic.

brew install shellcheck

License

Copyright for portions of project laptop are held by thoughtbot, inc 2011-2017 as part of thoughtbot/laptop. All other copyright for project carousell/laptop are held by Carousell, 2019.

It is free software, and may be redistributed under the terms specified in the LICENSE file.

About

Day one automated developer setup for Software Engineers @ Carousell.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 7

Languages