MCPcopy
hub / github.com/louislam/dockge / update

Method update

backend/stack.ts:446–465  ·  view source on GitHub ↗
(socket: DockgeSocket)

Source from the content-addressed store, hash-verified

444 }
445
446 async update(socket: DockgeSocket) {
447 const terminalName = getComposeTerminalName(socket.endpoint, this.name);
448 let exitCode = await Terminal.exec(this.server, socket, terminalName, "docker", [ "compose", "pull" ], this.path);
449 if (exitCode !== 0) {
450 throw new Error("Failed to pull, please check the terminal output for more information.");
451 }
452
453 // If the stack is not running, we don't need to restart it
454 await this.updateStatus();
455 log.debug("update", "Status: " + this.status);
456 if (this.status !== RUNNING) {
457 return exitCode;
458 }
459
460 exitCode = await Terminal.exec(this.server, socket, terminalName, "docker", [ "compose", "up", "-d", "--remove-orphans" ], this.path);
461 if (exitCode !== 0) {
462 throw new Error("Failed to restart, please check the terminal output for more information.");
463 }
464 return exitCode;
465 }
466
467 async joinCombinedTerminal(socket: DockgeSocket) {
468 const terminalName = getCombinedTerminalName(socket.endpoint, this.name);

Callers 3

shake256Function · 0.80
createMethod · 0.80

Calls 4

updateStatusMethod · 0.95
getComposeTerminalNameFunction · 0.90
execMethod · 0.80
debugMethod · 0.80

Tested by

no test coverage detected