Switch to CLI to launch CHE inside chedir instead of the Che launcher which is not anymore maintained (#3826)

Change-Id: I742383ab47ad34a9d94a4e3ce823e802023062c2
Signed-off-by: Florent BENOIT <fbenoit@codenvy.com>
6.19.x
Florent BENOIT 2017-01-20 05:23:13 -07:00 committed by GitHub
parent 25cf9f1ed5
commit 373210fdb5
1 changed files with 8 additions and 11 deletions

View File

@ -72,6 +72,7 @@ export class CheDir {
cheFile : any;
dotCheFolder : any;
workspacesFolder : any;
cliFolder : any;
dotCheIdFile : any;
dotCheSshPrivateKeyFile : any;
dotCheSshPublicKeyFile : any;
@ -105,6 +106,7 @@ export class CheDir {
this.dotCheSshPrivateKeyFile = this.path.resolve(this.dotCheFolder, 'ssh-key.private');
this.dotCheSshPublicKeyFile = this.path.resolve(this.dotCheFolder, 'ssh-key.public');
this.workspacesFolder = this.path.resolve(this.dotCheFolder, 'workspaces');
this.cliFolder = this.path.resolve(this.dotCheFolder, 'cli');
this.initDefault();
@ -113,11 +115,7 @@ export class CheDir {
this.authData = new AuthData();
// che launcher image name
if (process.env.CHE_LAUNCHER_IMAGE_NAME) {
this.cheLauncherImageName = process.env.CHE_LAUNCHER_IMAGE_NAME
} else {
this.cheLauncherImageName = 'eclipse/che-launcher';
}
this.cheLauncherImageName = 'eclipse/che';
}
@ -150,8 +148,8 @@ export class CheDir {
Log.getLogger().debug('Env variable', key, process.env[key]);
});*/
if (process.env.CHE_HOST_IP) {
this.chefileStruct.server.properties['CHE_HOST_IP'] = process.env.CHE_HOST_IP;
if (process.env.CHE_HOST) {
this.chefileStruct.server.properties['CHE_HOST'] = process.env.CHE_HOST;
}
@ -943,10 +941,10 @@ setupSSHKeys(workspaceDto: org.eclipse.che.api.workspace.shared.dto.WorkspaceDto
// continue with own properties
commandLine +=
' -v /var/run/docker.sock:/var/run/docker.sock' +
' -v ' + this.cliFolder + ':/data' +
' -e CHE_PORT=' + this.chefileStruct.server.port +
' -e CHE_DATA=' + this.workspacesFolder +
' -e CHE_SERVER_CONTAINER_NAME=' + this.getCheServerContainerName() +
' ' + this.cheLauncherImageName + ':' + containerVersion + ' start';
' ' + this.cheLauncherImageName + ':' + containerVersion + ' start --fast';
Log.getLogger().debug('Executing command line', commandLine);
@ -994,9 +992,8 @@ setupSSHKeys(workspaceDto: org.eclipse.che.api.workspace.shared.dto.WorkspaceDto
var commandLine: string = 'docker run --rm' +
' -v /var/run/docker.sock:/var/run/docker.sock' +
' -v ' + this.cliFolder + ':/data' +
' -e CHE_PORT=' + this.chefileStruct.server.port +
' -e CHE_DATA=' + this.workspacesFolder +
' -e CHE_SERVER_CONTAINER_NAME=' + this.getCheServerContainerName() +
' ' + this.cheLauncherImageName + ':' + containerVersion + ' stop';
Log.getLogger().debug('Executing command line', commandLine);