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.
DevOps-Bash-tools/setup/install_minishift.sh

48 lines
1.5 KiB
Bash

#!/usr/bin/env bash
#
# Author: Hari Sekhon
# Date: Aug 2019
#
# https://github.com/harisekhon/devops-bash-tools
#
# License: see accompanying LICENSE file
#
# https://www.linkedin.com/in/harisekhon
#
# Installs MiniShift 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 ! command -v minishift &>/dev/null; then
if ! command -v 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 minishift
brew cask install --force minishift
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
# quicker to just try, it'll tell you if it's already running
#if ! minishift status | grep -i Running; then
minishift start --vm-driver=virtualbox
#fi
# .bash.d/kubernetes.sh automatically sources this so 'oc' command is available in all new shells
# fails if no running minishift VM - in which case remove the .minishift.env to avoid errors on every new shell
minishift oc-env > ~/.minishift.env || rm -f ~/.minishift.env
else
echo "Only Mac is supported at this time"
exit 1
fi