(socket: DockgeSocket)
| 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); |
no test coverage detected