mirror of
https://github.com/louislam/dockge.git
synced 2024-11-27 13:14:03 +00:00
Update a stopped stack, will no longer start the stack
This commit is contained in:
parent
a007ec56f7
commit
0208684b50
1 changed files with 19 additions and 0 deletions
|
@ -174,6 +174,17 @@ export class Stack {
|
|||
return exitCode;
|
||||
}
|
||||
|
||||
updateStatus() {
|
||||
let statusList = Stack.getStatusList();
|
||||
let status = statusList.get(this.name);
|
||||
|
||||
if (status) {
|
||||
this._status = status;
|
||||
} else {
|
||||
this._status = UNKNOWN;
|
||||
}
|
||||
}
|
||||
|
||||
static getStackList(server : DockgeServer, useCacheForManaged = false) : Map<string, Stack> {
|
||||
let stacksDir = server.stacksDir;
|
||||
let stackList : Map<string, Stack>;
|
||||
|
@ -322,6 +333,14 @@ export class Stack {
|
|||
if (exitCode !== 0) {
|
||||
throw new Error("Failed to pull, please check the terminal output for more information.");
|
||||
}
|
||||
|
||||
// If the stack is not running, we don't need to restart it
|
||||
this.updateStatus();
|
||||
log.debug("update", "Status: " + this.status);
|
||||
if (this.status !== RUNNING) {
|
||||
return exitCode;
|
||||
}
|
||||
|
||||
exitCode = await Terminal.exec(this.server, socket, terminalName, "docker", [ "compose", "up", "-d", "--remove-orphans" ], this.path);
|
||||
if (exitCode !== 0) {
|
||||
throw new Error("Failed to restart, please check the terminal output for more information.");
|
||||
|
|
Loading…
Reference in a new issue