fix: pass paths in ioc cli commands

This commit is contained in:
Benjamin Labrecque
2026-07-22 12:14:45 +02:00
parent 7e690a907e
commit a552e537f4
+10 -6
View File
@@ -1,9 +1,10 @@
import typer
from config.paths import Paths
from core.ansible import run_playbook
from core.enums import IOC_ENV
from core.models import ServiceRegistry
from core.utils import get_git_root
from models import ServiceRegistry
ioc = typer.Typer(no_args_is_help=True)
@@ -35,10 +36,11 @@ def install(
def install_all(
env: IOC_ENV = typer.Option(..., "--env"),
):
registry = ServiceRegistry.read_from_config()
paths = Paths()
registry = ServiceRegistry.read_from_file(paths.service_registry_file)
services = registry.get_services()
branch_var = f"branch_name=main"
branch_var = "branch_name=main"
for service in services:
service_name_var = f"service_name_lower={service.name_lower}"
@@ -65,7 +67,8 @@ def start(
def start_all(
env: IOC_ENV = typer.Option(..., "--env"),
):
registry = ServiceRegistry.read_from_config()
paths = Paths()
registry = ServiceRegistry.read_from_file(paths.service_registry_file)
services = registry.get_services()
for service in services:
@@ -92,10 +95,11 @@ def restart(
def restart_all(
env: IOC_ENV = typer.Option(..., "--env"),
):
registry = ServiceRegistry.read_from_config()
paths = Paths()
registry = ServiceRegistry.read_from_file(paths.service_registry_file)
services = registry.get_services()
branch_var = f"branch_name=main"
branch_var = "branch_name=main"
for service in services:
service_name_var = f"service_name_lower={service.name_lower}"