Last active
December 6, 2018 01:43
-
-
Save jyee/0cbad4dc5c6b447528c19dd702ab4ba2 to your computer and use it in GitHub Desktop.
Kubernetes Workshop requirements installation
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
#!/bin/bash | |
# Install Homebrew | |
if [[ ! "$(command -v brew)" ]]; then | |
echo "Installing Homebrew..." | |
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" | |
fi | |
# Install Cask | |
echo "Installing Homebrew Cask..." | |
brew tap caskroom/cask | |
# Install Java | |
if [[ ! "$(command -v java)" ]]; then | |
echo "Installing Java..." | |
brew cask install java | |
fi | |
# Install or upgrade Docker | |
if [[ "$(command -v docker)" && "$(brew cask list | grep docker)" ]]; then | |
echo "Upgrading Docker..." | |
brew cask reinstall docker | |
else | |
echo "Installing Docker..." | |
brew cask install docker | |
fi | |
echo "Starting Docker. You may need to enter your credentials the first time Docker runs..." | |
open -a docker.app | |
# Install or upgrade Kubernetes CLI tools | |
if [[ "$(command -v kubectl)" && "$(brew list kubernetes-cli 2>/dev/null)" ]]; then | |
echo "Upgrading Kubernetes CLI tools..." | |
brew upgrade kubernetes-cli | |
else | |
echo "Installing Kubernetes CLI tools..." | |
brew install kubernetes-cli | |
fi | |
# Install or upgrade VirtualBox | |
if [[ "$(command -v virtualbox)" && "$(brew cask list | grep virtualbox)" ]]; then | |
echo "Upgrading Virtualbox..." | |
brew cask reinstall virtualbox | |
else | |
echo "Installing Virtualbox..." | |
brew cask install virtualbox | |
fi | |
# Install or upgrade Minikube | |
if [[ "$(command -v minikube)" && "$(brew cask list | grep minikube)" ]]; then | |
echo "Upgrading Minikube..." | |
rm /usr/local/bin/minikube | |
brew cask reinstall minikube | |
else | |
echo "Installing Minikube..." | |
brew cask install minikube | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment