From c0db45c963a09cc6ca3ad8d1ba747a602c2b59aa Mon Sep 17 00:00:00 2001 From: David Boreham Date: Sat, 13 Aug 2022 23:06:55 -0600 Subject: [PATCH] Add command --- deploy-system.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/deploy-system.py b/deploy-system.py index 86e56e8a..f0faf287 100644 --- a/deploy-system.py +++ b/deploy-system.py @@ -18,6 +18,7 @@ def include_exclude_check(s, args): parser = argparse.ArgumentParser( description="deploy the complete stack" ) +parser.add_argument("command", type=str, nargs=1, choices=['up', 'down', 'ps'], help="command: up|down|ps") parser.add_argument("--verbose", action="store_true", help="increase output verbosity") parser.add_argument("--quiet", action="store_true", help="don\'t print informational output") parser.add_argument("--check-only", action="store_true", help="looks at what\'s already there and checks if it looks good") @@ -56,6 +57,9 @@ if verbose: # See: https://gabrieldemarmiesse.github.io/python-on-whales/sub-commands/compose/ docker = DockerClient(compose_files=compose_files) +command = args.command if not args.dry_run: - docker.compose.up() - + if command == "up": + docker.compose.up() + elif command == "down": + docker.compose.down()