From bb8a222ce39648e2366ea5c41957c3dd127a5af7 Mon Sep 17 00:00:00 2001 From: prathamesh0 Date: Mon, 10 Apr 2023 16:00:43 +0530 Subject: [PATCH] Add an option to pass env file to deploy command --- app/deploy_system.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/deploy_system.py b/app/deploy_system.py index 9371a2f8..3c347fdf 100644 --- a/app/deploy_system.py +++ b/app/deploy_system.py @@ -32,11 +32,12 @@ from .util import include_exclude_check, get_parsed_stack_config @click.command() @click.option("--include", help="only start these components") @click.option("--exclude", help="don\'t start these components") +@click.option("--env-file", help="env file to be used") @click.option("--cluster", help="specify a non-default cluster name") @click.argument('command', required=True) # help: command: up|down|ps @click.argument('extra_args', nargs=-1) # help: command: up|down|ps @click.pass_context -def command(ctx, include, exclude, cluster, command, extra_args): +def command(ctx, include, exclude, env_file, cluster, command, extra_args): '''deploy a stack''' # TODO: implement option exclusion and command value constraint lost with the move from argparse to click @@ -51,7 +52,7 @@ def command(ctx, include, exclude, cluster, command, extra_args): cluster_context = _make_cluster_context(ctx.obj, include, exclude, cluster) # See: https://gabrieldemarmiesse.github.io/python-on-whales/sub-commands/compose/ - docker = DockerClient(compose_files=cluster_context.compose_files, compose_project_name=cluster_context.cluster) + docker = DockerClient(compose_files=cluster_context.compose_files, compose_project_name=cluster_context.cluster, compose_env_file=env_file) extra_args_list = list(extra_args) or None