This repository has been archived by the owner on Dec 1, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #68 from blinkreaction/develop
Release v1.4.0
- Loading branch information
Showing
7 changed files
with
76 additions
and
41 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
1.3.1 | ||
1.4.0 |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,43 @@ | ||
#!/bin/bash | ||
|
||
DOCKER_VERSION=1.9.0 | ||
DOCKER_COMPOSE_VERSION=1.5.0 | ||
DOCKER_VERSION=1.9.1 | ||
DOCKER_COMPOSE_VERSION=1.5.2 | ||
|
||
# Console colors | ||
red='\033[0;31m' | ||
green='\033[0;32m' | ||
yellow='\033[1;33m' | ||
NC='\033[0m' | ||
|
||
echo-red () { echo -e "${red}$1${NC}"; } | ||
echo-green () { echo -e "${green}$1${NC}"; } | ||
echo-yellow () { echo -e "${yellow}$1${NC}"; } | ||
|
||
# Homebrew installation | ||
echo -e "${green}Installing Homebrew...${NC}" | ||
echo-green "Installing Homebrew..." | ||
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" | ||
|
||
# Cask installation | ||
echo -e "${green}Installing Cask...${NC}" | ||
brew install caskroom/cask/brew-cask | ||
|
||
# Update brew formulae | ||
echo -e "${green}Updating brew formulae...${NC}" | ||
echo-green "Updating brew formulae..." | ||
brew update | ||
|
||
# VirtualBox installation | ||
echo -e "${green}Installing virtualbox...${NC}" | ||
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 | ||
VBoxManage hostonlyif remove vboxnet0 | ||
VBoxManage dhcpserver remove --netname HostInterfaceNetworking-vboxnet0 > /dev/null 2>&1 | ||
VBoxManage hostonlyif remove vboxnet0 > /dev/null 2>&1 | ||
|
||
# Vagrant installation | ||
echo -e "${green}Installing vagrant...${NC}" | ||
echo-green "Installing vagrant..." | ||
brew cask install vagrant | ||
|
||
# Install docker | ||
echo -e "${green}Installing docker...${NC}" | ||
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 | ||
|
||
# Install docker-compose | ||
echo -e "${green}Installing docker-compose...${NC}" | ||
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 |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,43 @@ | ||
#!/bin/bash | ||
|
||
DOCKER_VERSION=1.9.0 | ||
DOCKER_COMPOSE_VERSION=1.5.0 | ||
DOCKER_VERSION=1.9.1 | ||
DOCKER_COMPOSE_VERSION=1.5.2 | ||
|
||
# Console colors | ||
red='\033[0;31m' | ||
green='\033[0;32m' | ||
yellow='\033[1;33m' | ||
NC='\033[0m' | ||
|
||
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 -e "${red}[b2d-setup] testing mode: environment = \"${B2D_BRANCH}\"$NC" | ||
echo-red "[b2d-setup] testing mode: environment = ${B2D_BRANCH}" | ||
else | ||
B2D_BRANCH='master' | ||
fi | ||
|
||
# Install prerequisites via choco (virtualbox and vagrant) | ||
curl -L https://raw.githubusercontent.com/blinkreaction/boot2docker-vagrant/${B2D_BRANCH}/scripts/presetup-win.cmd -o $WINDIR/Temp/presetup-win.cmd | ||
curl -L https://raw.githubusercontent.com/blinkreaction/boot2docker-vagrant/${B2D_BRANCH}/scripts/presetup-win.vbs -o $WINDIR/Temp/presetup-win.vbs | ||
echo "Setup needs administrator privileges to contiue..." | ||
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 | ||
|
||
# Install Docker | ||
curl -L https://get.docker.com/builds/Windows/i386/docker-$DOCKER_VERSION.exe -o /usr/local/bin/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 | ||
chmod +x /usr/local/bin/docker | ||
|
||
# Install Docker Compose | ||
curl -L https://github.com/docker/compose/releases/download/$DOCKER_COMPOSE_VERSION/docker-compose-Windows-x86_64.exe > /usr/local/bin/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 > /usr/local/bin/docker-compose | ||
chmod +x /usr/local/bin/docker-compose | ||
|
||
# Git settings | ||
echo "Adjusting git defaults" | ||
echo-green "Adjusting git defaults..." | ||
git config --global core.autocrlf input | ||
git config --system core.longpaths true |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,58 +1,65 @@ | ||
#!/bin/bash | ||
|
||
# Docker Host IP | ||
DOCKER_HOST_IP='192.168.10.10' | ||
|
||
# Console colors | ||
red='\033[0;31m' | ||
green='\033[0;32m' | ||
yellow='\033[1;33m' | ||
NC='\033[0m' | ||
|
||
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 -e "${red}[b2d-setup] testing mode: environment = \"${B2D_BRANCH}\"$NC" | ||
echo-red "[b2d-setup] testing mode: environment = ${B2D_BRANCH}" | ||
else | ||
B2D_BRANCH='master' | ||
fi | ||
|
||
# Download Vagrantfile | ||
echo -e "${green}Downloading Vagrantfile into the current directory...${NC}" | ||
echo-green "Downloading Vagrantfile into the current directory..." | ||
curl -sO "https://raw.githubusercontent.com/blinkreaction/boot2docker-vagrant/${B2D_BRANCH}/Vagrantfile" | ||
|
||
# Download vagrant.yml | ||
echo -e "${green}Downloading vagrant.yml into the current directory...${NC}" | ||
echo-green "Downloading vagrant.yml into the current directory..." | ||
curl -sO "https://raw.githubusercontent.com/blinkreaction/boot2docker-vagrant/${B2D_BRANCH}/vagrant.yml" | ||
|
||
# Write DOCKER_HOST variable export to a matching .rc file based on the shell (bash or zsh) | ||
SOURCE_FILE='' | ||
DOCKER_HOST_EXPORT='\n# Docker (default for Vagrant based boxes)\nexport DOCKER_HOST=tcp://localhost:2375\n' | ||
DOCKER_HOST_EXPORT="\n# Docker (default for Vagrant based boxes)\nexport DOCKER_HOST=tcp://${DOCKER_HOST_IP}:2375\n" | ||
|
||
# Detect shell to write to the right .rc file | ||
if [[ $SHELL == '/bin/bash' || $SHELL == '/bin/sh' ]]; then SOURCE_FILE=".bash_profile"; fi | ||
if [[ $SHELL == '/bin/zsh' ]]; then SOURCE_FILE=".zshrc"; fi | ||
|
||
if [[ $SOURCE_FILE ]]; then | ||
# See if we already did this and skip if so | ||
grep -q "export DOCKER_HOST=tcp://localhost:2375" $HOME/$SOURCE_FILE | ||
grep -q "export DOCKER_HOST=tcp://${DOCKER_HOST_IP}:2375" $HOME/$SOURCE_FILE | ||
if [[ $? -ne 0 ]]; then | ||
echo -e "${green}Adding automatic DOCKER_HOST export to $HOME/$SOURCE_FILE${NC}" | ||
echo-green "Adding automatic DOCKER_HOST export to $HOME/$SOURCE_FILE" | ||
echo -e $DOCKER_HOST_EXPORT >> $HOME/$SOURCE_FILE | ||
fi | ||
else | ||
echo -e "${red}Cannot detect your shell. Please manually add the following to your respective .rc or .profile file:${NC}" | ||
echo-red "Cannot detect your shell. Please manually add the following to your respective .rc or .profile file:" | ||
echo -e "$DOCKER_HOST_EXPORT" | ||
fi | ||
|
||
if [[ $B2D_NO_AUTOSTART == '' ]]; then | ||
# Start the boot2docker VM | ||
echo -e "${green}Starting the boot2docker VM...${NC}" | ||
echo-green "Starting the boot2docker VM..." | ||
vagrant up | ||
|
||
# Check that Docker works | ||
echo -e "${green}Checking that everything is in place...${NC}" | ||
echo-green "Checking that everything is in place..." | ||
docker version && vagrant ssh -c 'docker-compose --version' | ||
if [[ $? -ne 0 ]]; then | ||
echo -e "${red}Something went wrong. Please review console output for possible clues.${NC}" | ||
exit 1 | ||
else | ||
echo -e "${green}Docker Host is up and running. Please restart your shell.${NC}" | ||
echo-green "Docker Host is up and running. Please restart your shell." | ||
fi | ||
fi |