From 302ff755935aeae571fa6a609a88dcaf7ad9c305 Mon Sep 17 00:00:00 2001 From: David Boreham Date: Mon, 24 Oct 2022 12:39:51 -0600 Subject: [PATCH 1/2] Output docker compose ps results --- app/deploy_system.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/deploy_system.py b/app/deploy_system.py index 7a5a417e..ae32d22e 100644 --- a/app/deploy_system.py +++ b/app/deploy_system.py @@ -82,7 +82,9 @@ def command(ctx, include, exclude, cluster, command): elif command == "ps": if verbose: print("Running compose ps") - docker.compose.ps() + container_list = docker.compose.ps() + for container in container_list: + print(f"id: {container.id}, name: {container.name}") elif command == "logs": if verbose: print("Running compose logs") From 548e4a8957ecc7425f464964bd566b5eca62ea1b Mon Sep 17 00:00:00 2001 From: David Boreham Date: Mon, 24 Oct 2022 16:02:11 -0600 Subject: [PATCH 2/2] Tidy up --- app/deploy_system.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/app/deploy_system.py b/app/deploy_system.py index ae32d22e..5534415c 100644 --- a/app/deploy_system.py +++ b/app/deploy_system.py @@ -79,12 +79,16 @@ def command(ctx, include, exclude, cluster, command): if verbose: print("Running compose down") docker.compose.down() - elif command == "ps": + elif command == "status": if verbose: print("Running compose ps") container_list = docker.compose.ps() - for container in container_list: - print(f"id: {container.id}, name: {container.name}") + if len(container_list) > 0: + print("Running containers:") + for container in container_list: + print(f"id: {container.id}, name: {container.name}") + else: + print("No containers running") elif command == "logs": if verbose: print("Running compose logs")