Add "docker compose down" (#122)

This commit is contained in:
Louis Lam
2023-11-21 18:17:11 +08:00
committed by GitHub
parent b7c6bbba67
commit e95ef66ca1
5 changed files with 50 additions and 0 deletions

View File

@ -330,6 +330,15 @@ export class Stack {
return exitCode;
}
async down(socket: DockgeSocket) : Promise<number> {
const terminalName = getComposeTerminalName(this.name);
let exitCode = await Terminal.exec(this.server, socket, terminalName, "docker", [ "compose", "down" ], this.path);
if (exitCode !== 0) {
throw new Error("Failed to down, please check the terminal output for more information.");
}
return exitCode;
}
async update(socket: DockgeSocket) {
const terminalName = getComposeTerminalName(this.name);
let exitCode = await Terminal.exec(this.server, socket, terminalName, "docker", [ "compose", "pull" ], this.path);