Skip to content

Commit

Permalink
fix token cli and debug option only
Browse files Browse the repository at this point in the history
  • Loading branch information
vinicvaz committed Nov 27, 2023
1 parent bafb24c commit 247b71a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 14 deletions.
10 changes: 2 additions & 8 deletions src/domino/cli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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()
Expand Down
9 changes: 3 additions & 6 deletions src/domino/cli/utils/platform.py
Original file line number Diff line number Diff line change
Expand Up @@ -642,22 +642,21 @@ 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.")
console.print("Please wait, this might take a few minutes...")
# 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()

Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 247b71a

Please sign in to comment.