* Convert the status string from `docker compose ls` to the status number * Input Example: "exited(1), running(1)" * @param status
(status : string)
| 361 | * @param status |
| 362 | */ |
| 363 | static statusConvert(status : string) : number { |
| 364 | if (status.startsWith("created")) { |
| 365 | return CREATED_STACK; |
| 366 | } else if (status.includes("exited")) { |
| 367 | // If one of the service is exited, we consider the stack is exited |
| 368 | return EXITED; |
| 369 | } else if (status.startsWith("running")) { |
| 370 | // If there is no exited services, there should be only running services |
| 371 | return RUNNING; |
| 372 | } else { |
| 373 | return UNKNOWN; |
| 374 | } |
| 375 | } |
| 376 | |
| 377 | static async getStack(server: DockgeServer, stackName: string, skipFSOperations = false) : Promise<Stack> { |
| 378 | let dir = path.join(server.stacksDir, stackName); |
no outgoing calls
no test coverage detected