Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change default machine name to che #972

Merged
merged 3 commits into from
Apr 8, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions assembly/assembly-main/src/assembly/bin/che.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ init_global_variables () {
Usage:
che [OPTIONS] [COMMAND]
-v, --vmware Use the docker-machine VMware driver (instead of VirtualBox)
-m:name, --machine:name For Win & Mac, sets the docker-machine VM name; default=default
-m:name, --machine:name For Win & Mac, sets the docker-machine VM name; default=che
-a:driver, --machine-driver:driver For Win & Mac, specifies the docker-machine driver to use; default=vbox
-p:port, --port:port Port that Che server will use for HTTP requests; default=8080
-r:ip, --remote:ip If Che clients are not localhost, set to IP address of Che server
Expand Down Expand Up @@ -72,7 +72,7 @@ https://eclipse-che.readme.io/docs/networking."
CHE_IP=
USE_HELP=false
CHE_SERVER_ACTION=run
VM=${CHE_DOCKER_MACHINE_NAME:-default}
VM=${CHE_DOCKER_MACHINE_NAME:-che}
MACHINE_DRIVER=virtualbox
CONTAINER=${CHE_CONTAINER_NAME:-che}
USE_DEBUG=false
Expand Down Expand Up @@ -346,13 +346,17 @@ get_docker_ready () {
fi
else
if [ ! -z "${VBOX_MSI_INSTALL_PATH}" ]; then
VBOXMANAGE=${VBOX_MSI_INSTALL_PATH}VBoxManage.exe
# Convert this directory to its short form name on Windows
if [ "${WIN}" == "true" ]; then
export VBOX_MSI_INSTALL_PATH=`(cd "${VBOX_MSI_INSTALL_PATH}" && cmd //C 'FOR %i in (.) do @echo %~Si')`\\
fi
VBOXMANAGE="${VBOX_MSI_INSTALL_PATH}"VBoxManage.exe
else
VBOXMANAGE=/usr/local/bin/VBoxManage
fi
VM_CHECK_CMD="${VBOXMANAGE} showvminfo ${VM}"
DOCKER_MACHINE_DRIVER=virtualbox
DOCKER_MACHINE_DRIVER_OPTIONS=--virtualbox-host-dns-resolver
DOCKER_MACHINE_DRIVER_OPTIONS='--virtualbox-host-dns-resolver --virtualbox-memory 2048 --virtualbox-cpu-count 2'
if [ ! -f "${VBOXMANAGE}" ]; then
error_exit "Could not find VirtualBox. Win: VBOX_MSI_INSTALL_PATH env variable not set. Add it or rerun Docker Toolbox installation. Mac: Expected Virtual Box at /usr/local/bin/VBoxManage."
return
Expand All @@ -367,9 +371,8 @@ get_docker_ready () {
# Test to see if the VM we need is already running
# Added || true to not fail due to set -e
${VM_CHECK_CMD} &> /dev/null || VM_EXISTS_CODE=$? || true

if [ "${VM_EXISTS_CODE}" == "1" ]; then
echo "Could not find an existing docker machine."
echo -e "Could not find an existing docker machine named ${GREEN}${VM}${NC}."
echo -e "Creating docker machine named ${GREEN}${VM}${NC}... Please be patient, this takes a couple minutes the first time."
"${DOCKER_MACHINE}" rm -f ${VM} &> /dev/null || true
rm -rf ~/.docker/machine/machines/${VM}
Expand Down