Skip to content

Commit 010cf60

Browse files
committed
Use getComposeOptions for all new docker compose calls
1 parent 502a729 commit 010cf60

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

backend/stack.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ export class Stack {
322322
}
323323

324324
// Get status from docker compose ls
325-
let res = await childProcessAsync.spawn("docker", [ "compose", "ls", "--all", "--format", "json" ], {
325+
let res = await childProcessAsync.spawn("docker", this.getComposeOptions("ls", "--all", "--format", "json"), {
326326
encoding: "utf-8",
327327
});
328328

@@ -423,7 +423,7 @@ export class Stack {
423423
static async getStatusList(): Promise<Map<string, number>> {
424424
let statusList = new Map<string, number>();
425425

426-
let res = await childProcessAsync.spawn("docker", [ "compose", "ls", "--all", "--format", "json" ], {
426+
let res = await childProcessAsync.spawn("docker", this.getComposeOptions("ls", "--all", "--format", "json"), {
427427
encoding: "utf-8",
428428
});
429429

@@ -579,7 +579,7 @@ export class Stack {
579579
return exitCode;
580580
}
581581

582-
exitCode = await Terminal.exec(this.server, socket, terminalName, "docker", [ "compose", "up", "-d", "--remove-orphans" ], this.path);
582+
exitCode = await Terminal.exec(this.server, socket, terminalName, "docker", this.getComposeOptions("up", "-d", "--remove-orphans"), this.path);
583583
if (exitCode !== 0) {
584584
throw new Error("Failed to restart, please check the terminal output for more information.");
585585
}
@@ -689,7 +689,7 @@ export class Stack {
689689

690690
async startService(socket: DockgeSocket, serviceName: string) {
691691
const terminalName = getComposeTerminalName(socket.endpoint, this.name);
692-
const exitCode = await Terminal.exec(this.server, socket, terminalName, "docker", [ "compose", "up", "-d", serviceName ], this.path);
692+
const exitCode = await Terminal.exec(this.server, socket, terminalName, "docker", this.getComposeOptions("up", "-d", serviceName), this.path);
693693
if (exitCode !== 0) {
694694
throw new Error(`Failed to start service ${serviceName}, please check logs for more information.`);
695695
}
@@ -699,7 +699,7 @@ export class Stack {
699699

700700
async stopService(socket: DockgeSocket, serviceName: string): Promise<number> {
701701
const terminalName = getComposeTerminalName(socket.endpoint, this.name);
702-
const exitCode = await Terminal.exec(this.server, socket, terminalName, "docker", [ "compose", "stop", serviceName ], this.path);
702+
const exitCode = await Terminal.exec(this.server, socket, terminalName, "docker", this.getComposeOptions("stop", serviceName), this.path);
703703
if (exitCode !== 0) {
704704
throw new Error(`Failed to stop service ${serviceName}, please check logs for more information.`);
705705
}
@@ -709,7 +709,7 @@ export class Stack {
709709

710710
async restartService(socket: DockgeSocket, serviceName: string): Promise<number> {
711711
const terminalName = getComposeTerminalName(socket.endpoint, this.name);
712-
const exitCode = await Terminal.exec(this.server, socket, terminalName, "docker", [ "compose", "restart", serviceName ], this.path);
712+
const exitCode = await Terminal.exec(this.server, socket, terminalName, "docker", this.getComposeOptions("restart", serviceName), this.path);
713713
if (exitCode !== 0) {
714714
throw new Error(`Failed to restart service ${serviceName}, please check logs for more information.`);
715715
}

0 commit comments

Comments
 (0)