diff --git a/CHANGELOG.md b/CHANGELOG.md index ab1ee2c..7ec058c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## 1.6.1 (2016-06-03) + +- Hotfix for downloading new docker binary versions +- Added B2D_INSTALL_MODE switch +- Updated docs + + ## 1.6.0 (2016-06-03) - Switched to blinkreaction/boot2docker base box [v1.11.2](https://atlas.hashicorp.com/blinkreaction/boxes/boot2docker/versions/1.11.2) diff --git a/README.md b/README.md index 6618628..c8baa79 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,10 @@ For best result and a clean setup it is recommended to remove any previous versi Automatic **installation** and **updates** of prerequisites is available via the one-liners below. **Make sure to stop all VirtualBox VMs prior to performing updates.** +Note: If you already have brew/cask and necessary versions of VirtualBox and Vagrant installed, +prefer to install them manually or would like to not update these components automatically, +prefix the command with `B2D_INSTALL_MODE=docker `. + **Mac** Prerequisites are installed using **brew/cask** (brew and cask will be installed if missing). diff --git a/VERSION b/VERSION index ce6a70b..2eda823 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.6.0 \ No newline at end of file +1.6.1 \ No newline at end of file diff --git a/scripts/presetup-mac.sh b/scripts/presetup-mac.sh index fbecd8d..9002ee7 100755 --- a/scripts/presetup-mac.sh +++ b/scripts/presetup-mac.sh @@ -13,35 +13,46 @@ echo-red () { echo -e "${red}$1${NC}"; } echo-green () { echo -e "${green}$1${NC}"; } echo-yellow () { echo -e "${yellow}$1${NC}"; } -# Homebrew installation -echo-green "Installing Homebrew..." -ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" - -# Update brew formulae -echo-green "Updating brew formulae..." -brew update - -# VirtualBox installation -echo-green "Installing virtualbox..." -brew cask install virtualbox -# Kill the default adapter and DHCP server to avoid network issues down the road -VBoxManage dhcpserver remove --netname HostInterfaceNetworking-vboxnet0 > /dev/null 2>&1 -VBoxManage hostonlyif remove vboxnet0 > /dev/null 2>&1 - -# Vagrant installation -echo-green "Installing vagrant..." -brew cask install vagrant - -# Remove old docker version -sudo rm -f /usr/local/bin/docker >/dev/null 2>&1 || true -# Install docker -echo-green "Installing docker cli v${DOCKER_VERSION}..." -sudo curl -sSL "https://get.docker.com/builds/$(uname -s)/$(uname -m)/docker-$DOCKER_VERSION" -o /usr/local/bin/docker -sudo chmod +x /usr/local/bin/docker - -# Remove old docker-compose version -sudo rm -f /usr/local/bin/docker-compose >/dev/null 2>&1 || true -# Install docker-compose -echo-green "Installing docker-compose v${DOCKER_COMPOSE_VERSION}..." -sudo curl -sSL "https://github.com/docker/compose/releases/download/$DOCKER_COMPOSE_VERSION/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose -sudo chmod +x /usr/local/bin/docker-compose +B2D_BRANCH="${B2D_BRANCH:-master}" +B2D_INSTALL_MODE="${B2D_INSTALL_MODE:-full}" + +# VirtualBox and Vagrant dependencies +if [[ "$B2D_INSTALL_MODE" == "full" ]] || [[ "$B2D_INSTALL_MODE" == "vm" ]] ; then + # Homebrew installation + echo-green "Installing Homebrew..." + ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" + + # Update brew formulae + echo-green "Updating brew formulae..." + brew update + + # VirtualBox installation + echo-green "Installing virtualbox..." + brew cask install virtualbox + # Kill the default adapter and DHCP server to avoid network issues down the road + VBoxManage dhcpserver remove --netname HostInterfaceNetworking-vboxnet0 > /dev/null 2>&1 + VBoxManage hostonlyif remove vboxnet0 > /dev/null 2>&1 + + # Vagrant installation + echo-green "Installing vagrant..." + brew cask install vagrant +fi + +# Docker and other dependencies +if [[ "$B2D_INSTALL_MODE" == "full" ]] || [[ "$B2D_INSTALL_MODE" == "docker" ]] ; then + # Remove old docker version + sudo rm -f /usr/local/bin/docker >/dev/null 2>&1 || true + # Install docker + echo-green "Installing docker cli v${DOCKER_VERSION}..." + curl -sSL -O "https://get.docker.com/builds/$(uname -s)/$(uname -m)/docker-$DOCKER_VERSION.tgz" + tar zxf docker-$DOCKER_VERSION.tgz + sudo mv docker/* /usr/local/bin + rm -rf docker-$DOCKER_VERSION* + + # Remove old docker-compose version + sudo rm -f /usr/local/bin/docker-compose >/dev/null 2>&1 || true + # Install docker-compose + echo-green "Installing docker-compose v${DOCKER_COMPOSE_VERSION}..." + sudo curl -sSL "https://github.com/docker/compose/releases/download/$DOCKER_COMPOSE_VERSION/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose + sudo chmod +x /usr/local/bin/docker-compose +fi diff --git a/scripts/presetup-win.sh b/scripts/presetup-win.sh index de4c372..b061dfc 100644 --- a/scripts/presetup-win.sh +++ b/scripts/presetup-win.sh @@ -14,42 +14,46 @@ echo-red () { echo -e "${red}$1${NC}"; } echo-green () { echo -e "${green}$1${NC}"; } echo-yellow () { echo -e "${yellow}$1${NC}"; } -# For testing -if [ ! $B2D_BRANCH == "" ]; then - echo-red "[b2d-setup] testing mode: environment = ${B2D_BRANCH}" -else - B2D_BRANCH='master' +B2D_BRANCH="${B2D_BRANCH:-master}" +B2D_INSTALL_MODE="${B2D_INSTALL_MODE:-full}" + +# VirtualBox and Vagrant dependencies +if [[ "$B2D_INSTALL_MODE" == "full" ]] || [[ "$B2D_INSTALL_MODE" == "vm" ]] ; then + # Install prerequisites via choco (virtualbox and vagrant) + echo-green "Installing virtualbox and vagrant via choco..." + curl -sSL https://raw.githubusercontent.com/blinkreaction/boot2docker-vagrant/${B2D_BRANCH}/scripts/presetup-win.cmd -o $WINDIR/Temp/presetup-win.cmd + curl -sSL https://raw.githubusercontent.com/blinkreaction/boot2docker-vagrant/${B2D_BRANCH}/scripts/presetup-win.vbs -o $WINDIR/Temp/presetup-win.vbs + echo-yellow "Setup needs administrator privileges to contiue..." + cscript $WINDIR/Temp/presetup-win.vbs fi -# Install prerequisites via choco (virtualbox and vagrant) -echo-green "Installing virtualbox and vagrant via choco..." -curl -sSL https://raw.githubusercontent.com/blinkreaction/boot2docker-vagrant/${B2D_BRANCH}/scripts/presetup-win.cmd -o $WINDIR/Temp/presetup-win.cmd -curl -sSL https://raw.githubusercontent.com/blinkreaction/boot2docker-vagrant/${B2D_BRANCH}/scripts/presetup-win.vbs -o $WINDIR/Temp/presetup-win.vbs -echo-yellow "Setup needs administrator privileges to contiue..." -cscript $WINDIR/Temp/presetup-win.vbs - -# Remove old docker version -rm -f /usr/local/bin/docker >/dev/null 2>&1 || true -# Install Docker -echo-green "Installing docker cli v${DOCKER_VERSION}..." -curl -sSL https://get.docker.com/builds/Windows/i386/docker-$DOCKER_VERSION.exe -o /usr/local/bin/docker.exe -chmod +x /usr/local/bin/docker.exe - -# Remove old docker-compose version -rm -f /usr/local/bin/docker-compose >/dev/null 2>&1 || true -# Install Docker Compose -echo-green "Installing docker-compose v${DOCKER_COMPOSE_VERSION}..." -curl -sSL https://github.com/docker/compose/releases/download/$DOCKER_COMPOSE_VERSION/docker-compose-Windows-x86_64.exe -o /usr/local/bin/docker-compose.exe -chmod +x /usr/local/bin/docker-compose.exe - -# Install winpty -echo-green "Installing winpty (console) v$WINPTY_VERSION..." -curl -sSL -O https://github.com/rprichard/winpty/releases/download/$WINPTY_VERSION/winpty-$WINPTY_VERSION-cygwin-2.4.1-ia32.tar.gz -tar -xf winpty-$WINPTY_VERSION-cygwin-2.4.1-ia32.tar.gz -mv winpty-$WINPTY_VERSION-cygwin-2.4.1-ia32/bin/* /usr/local/bin -rm -rf winpty-$WINPTY_VERSION-cygwin-2.4.1-ia32* - -# Git settings -echo-green "Adjusting git defaults..." -git config --global core.autocrlf input -git config --system core.longpaths true +# Docker and other dependencies +if [[ "$B2D_INSTALL_MODE" == "full" ]] || [[ "$B2D_INSTALL_MODE" == "docker" ]] ; then + # Remove old docker version + rm -f /usr/local/bin/docker >/dev/null 2>&1 || true + # Install Docker + echo-green "Installing docker cli v${DOCKER_VERSION}..." + curl -sSL -O https://get.docker.com/builds/Windows/i386/docker-$DOCKER_VERSION.zip + unzip docker-$DOCKER_VERSION.zip + mv docker/* /usr/local/bin + rm -rf docker-$DOCKER_VERSION* + + # Remove old docker-compose version + rm -f /usr/local/bin/docker-compose >/dev/null 2>&1 || true + # Install Docker Compose + echo-green "Installing docker-compose v${DOCKER_COMPOSE_VERSION}..." + curl -sSL https://github.com/docker/compose/releases/download/$DOCKER_COMPOSE_VERSION/docker-compose-Windows-x86_64.exe -o /usr/local/bin/docker-compose.exe + chmod +x /usr/local/bin/docker-compose.exe + + # Install winpty + echo-green "Installing winpty (console) v$WINPTY_VERSION..." + curl -sSL -O https://github.com/rprichard/winpty/releases/download/$WINPTY_VERSION/winpty-$WINPTY_VERSION-cygwin-2.4.1-ia32.tar.gz + tar -xf winpty-$WINPTY_VERSION-cygwin-2.4.1-ia32.tar.gz + mv winpty-$WINPTY_VERSION-cygwin-2.4.1-ia32/bin/* /usr/local/bin + rm -rf winpty-$WINPTY_VERSION-cygwin-2.4.1-ia32* + + # Git settings + echo-green "Adjusting git defaults..." + git config --global core.autocrlf input + git config --system core.longpaths true +fi