Created
October 26, 2017 00:07
-
-
Save trane/ec61ca00571b2b4627cff3ad60148c5f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
declare -ir brew_installed=$(command -v brew 2>&1 > /dev/null) | |
if [ "${brew_installed}" -ne 0 ]; then | |
echo "Installing homebrew" | |
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" | |
else | |
echo "Homebrew already installed" | |
fi | |
brew tap | grep -q -i caskroom/versions | |
if [ "$?" -ne 0 ]; then | |
echo "Adding the java8 cask to brew" | |
brew tap caskroom/versions | |
fi | |
declare -r cask_pkgs="java8 docker keybase intellij-idea-ce" | |
declare -r pkgs="sbt git awscli ammonite-repl" | |
for pkg in $cask_pkgs; do | |
if brew cask ls --versions $pkg > /dev/null; then | |
echo "Skipping cask $pkg" | |
else | |
echo "Installing cask $pkg" | |
brew cask install $pkg | |
fi | |
done | |
for pkg in $pkgs; do | |
if brew ls --versions $pkg > /dev/null; then | |
echo "Skipping $pkg" | |
else | |
echo "Installing $pkg" | |
brew install $pkg | |
fi | |
done | |
if brew ls --versions xhyve > /dev/null; then | |
echo "Skipping xhyve" | |
else | |
echo "Installing k8s/minikube" | |
brew install --HEAD xhyve | |
brew install docker-machine-driver-xhyve | |
fi | |
declare -r docker_machine="$(stat -LF "$(brew --prefix)/opt/docker-machine-driver-xhyve/bin/docker-machine-driver-xhyve")" | |
echo "${docker_machine}" | grep -q "root wheel" | |
if [ "$?" -ne 0 ]; then | |
echo "Docker requires superuser privs" | |
sudo chown root:wheel $docker_machine | |
sudo chmod u+s $docker_machine | |
fi | |
if brew cask ls --versions minikube > /dev/null; then | |
echo "Skipping minikube" | |
else | |
echo "Installing minikube" | |
brew cask install minikube | |
fi | |
echo "Completed bootstrapping the mac" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment