You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
#!/usr/bin/env bash
|
|
|
|
# shellcheck disable=SC2230
|
|
|
|
#
|
|
|
|
# Author: Hari Sekhon
|
|
|
|
# Date: early 2019
|
|
|
|
#
|
|
|
|
# https://github.com/harisekhon/devops-bash-tools
|
|
|
|
#
|
|
|
|
# License: see accompanying LICENSE file
|
|
|
|
#
|
|
|
|
# https://www.linkedin.com/in/harisekhon
|
|
|
|
#
|
|
|
|
|
|
|
|
# Installs MiniKube on Mac - needs VirtualBox to be installed first
|
|
|
|
|
|
|
|
#set -euo pipefail
|
|
|
|
set -u
|
|
|
|
|
|
|
|
#[ -n "${DEBUG:-}" ] &&
|
|
|
|
set -x
|
|
|
|
|
|
|
|
srcdir="$(dirname "$0")"
|
|
|
|
|
|
|
|
if [ "$(uname -s)" = Darwin ]; then
|
|
|
|
if ! type -P minikube &>/dev/null; then
|
|
|
|
if ! type -P brew &>/dev/null; then
|
|
|
|
echo "HomeBrew needs to be installed first, trying to install now"
|
|
|
|
"$srcdir/install_homebrew.sh"
|
|
|
|
fi
|
|
|
|
brew update
|
|
|
|
brew cask install minikube
|
|
|
|
brew install docker-machine-driver-xhyve
|
|
|
|
fi
|
|
|
|
brew_prefix="$(brew --prefix)"
|
|
|
|
sudo chown root:wheel "$brew_prefix"/opt/docker-machine-driver-xhyve/bin/docker-machine-driver-xhyve
|
|
|
|
sudo chmod u+s "$brew_prefix"/opt/docker-machine-driver-xhyve/bin/docker-machine-driver-xhyve
|
|
|
|
if [ -z "${NO_START:-}" ] &&
|
|
|
|
[ -z "${QUICK:-}" ] &&
|
|
|
|
! minikube status | grep -i Running; then
|
|
|
|
minikube start
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
echo "Only Mac is supported at this time"
|
|
|
|
exit 1
|
|
|
|
fi
|