From a3d1961f2216ca49a4436fb217458c318ac607d3 Mon Sep 17 00:00:00 2001 From: Josh VanDeraa Date: Mon, 31 Jul 2023 21:59:57 -0500 Subject: [PATCH] Converts Docker Compose to plugin --- tasks.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tasks.py b/tasks.py index 9e8cb71f..c1f7a98d 100644 --- a/tasks.py +++ b/tasks.py @@ -77,26 +77,26 @@ def task_wrapper(function=None): def docker_compose(context, command, **kwargs): - """Helper function for running a specific docker-compose command with all appropriate parameters and environment. + """Helper function for running a specific docker compose command with all appropriate parameters and environment. Args: context (obj): Used to run specific commands - command (str): Command string to append to the "docker-compose ..." command, such as "build", "up", etc. + command (str): Command string to append to the "docker compose ..." command, such as "build", "up", etc. **kwargs: Passed through to the context.run() call. """ build_env = { - # Note: 'docker-compose logs' will stop following after 60 seconds by default, + # Note: 'docker compose logs' will stop following after 60 seconds by default, # so we are overriding that by setting this environment variable. "COMPOSE_HTTP_TIMEOUT": context.design_builder.compose_http_timeout, "NAUTOBOT_VER": context.design_builder.nautobot_ver, "PYTHON_VER": context.design_builder.python_ver, } - compose_command = f'docker-compose --project-name {context.design_builder.project_name} --project-directory "{context.design_builder.compose_dir}"' + compose_command = f'docker compose --project-name {context.design_builder.project_name} --project-directory "{context.design_builder.compose_dir}"' for compose_file in context.design_builder.compose_files: compose_file_path = os.path.join(context.design_builder.compose_dir, compose_file) compose_command += f' -f "{compose_file_path}"' compose_command += f" {command}" - print(f'Running docker-compose command "{command}"') + print(f'Running docker compose command "{command}"') return context.run(compose_command, env=build_env, **kwargs) @@ -193,13 +193,13 @@ def vscode(context): @task( help={ - "service": "Docker-compose service name to view (default: nautobot)", + "service": "docker compose service name to view (default: nautobot)", "follow": "Follow logs", "tail": "Tail N number of lines or 'all'", } ) def logs(context, service="nautobot", follow=False, tail=None): - """View the logs of a docker-compose service.""" + """View the logs of a docker compose service.""" command = "logs " if follow: