From 8315413046e4b54278f504fd31398154f2ff4782 Mon Sep 17 00:00:00 2001 From: Cameron Diver Date: Tue, 29 Jan 2019 11:47:41 +0000 Subject: [PATCH] Add missing ServiceManager methods Change-type: patch Signed-off-by: Cameron Diver --- src/compose/service-manager.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/compose/service-manager.ts b/src/compose/service-manager.ts index a8211f69..c86e45ea 100644 --- a/src/compose/service-manager.ts +++ b/src/compose/service-manager.ts @@ -226,6 +226,15 @@ export class ServiceManager extends (EventEmitter as { } } } + public getAllByAppId(appId: number) { + return this.getAll(`app-id=${appId}`); + } + + public async stopAllByAppId(appId: number) { + for (const app of await this.getAllByAppId(appId)) { + await this.kill(app, { removeContainer: false }); + } + } public async create(service: Service) { const mockContainerId = this.config.newUniqueKey();