Skip to content

Instantly share code, notes, and snippets.

@philcryer
Created October 12, 2017 03:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save philcryer/3f4f40f1fd4c7eb8bc4b7bad1f162a79 to your computer and use it in GitHub Desktop.
Save philcryer/3f4f40f1fd4c7eb8bc4b7bad1f162a79 to your computer and use it in GitHub Desktop.
An attempt to automate the bootstrapping of a macOS based developer machine.
#!/usr/bin/env bash
# bootstrap macOS 10.xx with development tools:
# Xcode commandline-tools
# brew
# brew-cask
# ansible
# vagrant
# virtualbox
# docker
# docker-compose
# fail on error
set -e
# get macOS version
macOSversion=`sw_vers -productVersion`
# install Xcode commandline tools for our macOS version (via softwareupdate)
# most of this from https://github.com/id-nicola/vagrant-ansible-aem/blob/master/setup.sh
echo "Install Command Line Tools..."
touch /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress;
PROD=$(softwareupdate -l | grep "\*.*Command Line" | grep "$macOSversion" | head -n 1 | awk -F"*" '{print $2}' | sed -e 's/^ *//' | tr -d '\n')
softwareupdate -i "$PROD";
rm /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress;
# install Brew (via cURL)
echo "Install Brew..."
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
# install Brew-cask (from brew)
echo "Install Brew-cask..."
brew install cask
# install Ansible (from brew)
echo "Installing Ansible..."
brew install ansible
# install Vagrant (from cask)
# from https://www.snip2code.com/Snippet/33313/installs-brew--virtualbox--and-vagrant-i
echo "Installing Vagrant..."
brew cask install vagrant;
# install VirtualBox (from cask)
echo "Installing Virtualbox..."
#brew cask install virtualbox;
brew install Caskroom/cask/virtualbox
# install Docker (from brew)
echo "Installing Docker..."
brew install docker
# install Docker-compose (from brew)
echo "Installing Docker-compose..."
brew install docker-compose
# setup Docker (via docker-machine)
echo "Setting up docker..."
docker-machine create main
eval $(docker-machine env main)
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment