@forge/cli
12.14.0-next.9-experimental-44a932f12.14.0-next.14-experimental-3fd1b86
out/command-line/controller/tunnel-controller.js~
out/command-line/controller/tunnel-controller.jsModified+1−29
Index: package/out/command-line/controller/tunnel-controller.js
===================================================================
--- package/out/command-line/controller/tunnel-controller.js
+++ package/out/command-line/controller/tunnel-controller.js
@@ -8,16 +8,14 @@
nodeTunnelService;
tunnelView;
configFile;
cachedConfigService;
- containerCommandService;
environmentClient;
- constructor(nodeTunnelService, tunnelView, configFile, cachedConfigService, containerCommandService, environmentClient) {
+ constructor(nodeTunnelService, tunnelView, configFile, cachedConfigService, environmentClient) {
this.nodeTunnelService = nodeTunnelService;
this.tunnelView = tunnelView;
this.configFile = configFile;
this.cachedConfigService = cachedConfigService;
- this.containerCommandService = containerCommandService;
this.environmentClient = environmentClient;
}
async run(tunnelOptions) {
const options = await this.validateTunnelCommandOptions(tunnelOptions);
@@ -41,23 +39,10 @@
throw new tunnel_service_1.EnvironmentIsNotDefined(envKey);
}
throw err;
}
- const childProcess = await this.containerCommandService.authenticateDocker();
- await this.processDockerAuthentication(childProcess);
const dockerComposeFilePaths = await (0, cli_shared_1.generateContainersDockerComposeFile)(services, appId, envId);
options.containersDockerComposeFiles = dockerComposeFilePaths;
- try {
- for (const [serviceKey, filePath] of Object.entries(dockerComposeFilePaths)) {
- await (0, cli_shared_1.startDockerComposeStack)(filePath, serviceKey);
- }
- }
- catch (err) {
- for (const filePath of Object.values(dockerComposeFilePaths)) {
- await (0, cli_shared_1.deleteDockerComposeFile)(filePath);
- }
- throw err;
- }
}
if (modules) {
const uiKit1Modules = (0, cli_shared_1.findUIKit1Modules)(modules);
if (uiKit1Modules.length > 0) {
@@ -65,21 +50,8 @@
}
}
return await this.nodeTunnelService.run(options);
}
- async processDockerAuthentication(childProcess) {
- await new Promise((resolve, reject) => {
- childProcess.on('close', (code) => {
- if (code === 0) {
- resolve();
- }
- else {
- reject(new tunnel_service_1.DockerAuthenticationError(code?.toString() || 'unknown'));
- }
- });
- childProcess.on('error', reject);
- });
- }
async validateTunnelCommandOptions(tunnelOptions) {
const assistantName = this.cachedConfigService.getAssistantName();
const options = {
...tunnelOptions,