From 247b71a5cb5fe31591b249c5de0ae7abaa6c696a Mon Sep 17 00:00:00 2001 From: vinicvaz Date: Mon, 27 Nov 2023 18:32:42 -0300 Subject: [PATCH] fix token cli and debug option only --- src/domino/cli/cli.py | 10 ++-------- src/domino/cli/utils/platform.py | 9 +++------ 2 files changed, 5 insertions(+), 14 deletions(-) diff --git a/src/domino/cli/cli.py b/src/domino/cli/cli.py index eaf00d94..270b6807 100644 --- a/src/domino/cli/cli.py +++ b/src/domino/cli/cli.py @@ -195,12 +195,6 @@ def cli_destroy_platform(): @click.command() -@click.option( - "--d", - is_flag=True, - help="Run in detached mode.", - default=False -) @click.option( '--use-config-file', is_flag=True, @@ -231,12 +225,12 @@ def cli_destroy_platform(): help='Github token for access default pieces repositories.', default=get_github_token_pieces_from_config_or_env, ) -def cli_run_platform_compose(d, use_config_file, dev, debug, stop, github_token): +def cli_run_platform_compose(use_config_file, dev, debug, stop, github_token): """Run Domino platform locally with docker compose. Do NOT use this in production.""" if stop: platform.stop_platform_compose() else: - platform.run_platform_compose(github_token=github_token, detached=d, use_config_file=use_config_file, dev=dev, debug=debug) + platform.run_platform_compose(github_token=github_token, use_config_file=use_config_file, dev=dev, debug=debug) @click.command() diff --git a/src/domino/cli/utils/platform.py b/src/domino/cli/utils/platform.py index f9711cff..1c7d1394 100644 --- a/src/domino/cli/utils/platform.py +++ b/src/domino/cli/utils/platform.py @@ -642,10 +642,9 @@ def destroy_platform() -> None: def run_platform_compose( - github_token: str, - detached: bool = False, + github_token: str, use_config_file: bool = False, - dev: bool = False, + dev: bool = False, debug: bool = False ) -> None: console.print("Starting Domino Platform using Docker Compose.") @@ -653,11 +652,11 @@ def run_platform_compose( # Database default settings create_database = True os.environ['DOMINO_CREATE_DEFAULT_USER'] = 'true' + os.environ['DOMINO_DEFAULT_PIECES_REPOSITORY_TOKEN'] = github_token if use_config_file: console.print("Using config file...") with open("config-domino-local.toml", "rb") as f: platform_config = tomli.load(f) - os.environ['DOMINO_DEFAULT_PIECES_REPOSITORY_TOKEN'] = github_token create_database = platform_config['domino_db'].get('DOMINO_CREATE_DATABASE', True) os.environ['DOMINO_CREATE_DEFAULT_USER'] = str(platform_config['domino_db'].get('DOMINO_CREATE_DEFAULT_USER', 'true')).lower() @@ -722,8 +721,6 @@ def run_platform_compose( "compose", "up" ] - if detached and not debug: - cmd.append("-d") if debug: subprocess.Popen(cmd, env=environment)