Skip to content

Commit

Permalink
Merge pull request #579 from eclipse/CHE-275
Browse files Browse the repository at this point in the history
CHE-275: rename DOCKER_MACHINE_HOST to CHE_DOCKER_MACHINE_HOST
  • Loading branch information
Alexander Garagatyi committed Mar 1, 2016
2 parents 4b81105 + 4f1d970 commit d24415b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 11 deletions.
4 changes: 2 additions & 2 deletions assembly/assembly-main/src/assembly/bin/che.sh
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ set_environment_variables () {
fi

if [[ "${CHE_IP}" != "" ]]; then
export DOCKER_MACHINE_HOST="${CHE_IP}"
export CHE_DOCKER_MACHINE_HOST="${CHE_IP}"
fi

#if [ "${WIN}" == "true" ] && [ ! -z "${JAVA_HOME}" ]; then
Expand Down Expand Up @@ -566,7 +566,7 @@ kill_and_launch_docker_che () {
-v //home/user/che/lib:/home/user/che/lib-copy \
-v //home/user/che/workspaces:/home/user/che/workspaces \
-v //home/user/che/tomcat/temp/local-storage:/home/user/che/tomcat/temp/local-storage \
-e DOCKER_MACHINE_HOST=${DOCKER_PRINT_VALUE} --name ${CONTAINER} -d --net=host codenvy/che:${CHE_DOCKER_TAG} \
-e CHE_DOCKER_MACHINE_HOST=${DOCKER_PRINT_VALUE} --name ${CONTAINER} -d --net=host codenvy/che:${CHE_DOCKER_TAG} \
bash -c "tail -f /dev/null" || DOCKER_EXIT=$? || true
set +x
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,27 +19,30 @@
import javax.inject.Inject;
import javax.inject.Named;

import static com.google.common.base.MoreObjects.firstNonNull;

/**
* Gets predefined docker containers host for machine servers instead of evaluating it from docker configuration
*
* <p>Value of host can be retrieved from property ${code machine.docker.local_node_host} or
* from environment variable {@code DOCKER_MACHINE_HOST}.<br>
* from environment variable {@code CHE_DOCKER_MACHINE_HOST}.<br>
* Environment variable has lower priority.
*
* @author Alexander Garagatyi
* @see org.eclipse.che.plugin.docker.machine.ServerConf
*/
public class LocalDockerInstanceMetadata extends DockerInstanceRuntimeInfo {
public class LocalDockerInstanceRuntimeInfo extends DockerInstanceRuntimeInfo {
/**
* Env variable that shows host (or IP) where docker machines are deployed
*/
public static final String DOCKER_MACHINE_HOST = "DOCKER_MACHINE_HOST";
public static final String CHE_DOCKER_MACHINE_HOST = "CHE_DOCKER_MACHINE_HOST";

@Inject
public LocalDockerInstanceMetadata(@Assisted ContainerInfo containerInfo,
@Assisted String containerHost,
@Nullable @Named("machine.docker.local_node_host") String dockerNodeHost) {
super(containerInfo, dockerNodeHost != null ? dockerNodeHost :
(System.getenv(DOCKER_MACHINE_HOST) != null ? System.getenv(DOCKER_MACHINE_HOST) : containerHost));
public LocalDockerInstanceRuntimeInfo(@Assisted ContainerInfo containerInfo,
@Assisted String containerHost,
@Nullable @Named("machine.docker.local_node_host") String dockerNodeHost) {
super(containerInfo, firstNonNull(firstNonNull(dockerNodeHost,
System.getenv(CHE_DOCKER_MACHINE_HOST)),
containerHost));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ protected void configure() {
.implement(InstanceProcess.class, DockerProcess.class)
.implement(DockerNode.class, LocalDockerNode.class)
.implement(DockerInstanceRuntimeInfo.class,
org.eclipse.che.plugin.docker.machine.local.LocalDockerInstanceMetadata.class)
org.eclipse.che.plugin.docker.machine.local.LocalDockerInstanceRuntimeInfo.class)
.build(org.eclipse.che.plugin.docker.machine.DockerMachineFactory.class));


Expand Down

0 comments on commit d24415b

Please sign in to comment.