chore: fix templating
Deploy bin / deploy (push) Canceled after 0s
Deploy service MASTER / deploy (push) Canceled after 0s

This commit is contained in:
Benjamin Labrecque
2026-07-03 15:02:08 +02:00
parent 4699b0f606
commit 09edcf53a2
34 changed files with 123 additions and 426 deletions
+18 -6
View File
@@ -1,24 +1,36 @@
import typer
from core.git import git_push_service_directory
from core.models import ServiceRegistry
from core.render_templates import render_new_service_templates
from core.utils import get_git_root, init_logging
service = typer.Typer(no_args_is_help=True)
REPO_ROOT = get_git_root(__file__)
@service.command()
def add(
name: str = typer.Option(..., "--name", "-n"),
):
init_logging()
# TODO: add restriction on name (maybe: [a-zA-Z0-9-])
registry = ServiceRegistry.read_from_config()
service_id = registry.add_service(name)
service = registry.add_service(name)
render_new_service_templates(
service_id=service_id,
service_name=name,
ioc_host="",
ioc_port=9999,
user="",
service_id=service.id_str,
service_name_upper=service.name_upper,
service_name_lower=service.name_lower,
ioc_host="ex-host", # TODO
ioc_port=9999, # TODO
user="user", # TODO
)
git_push_service_directory(
repo_root=REPO_ROOT,
branch_name=f"feature/add-service-{service.name_lower}",
service_dir_rel_path=f"services/{service.dir_name}",
commit_msg=f"feature: add new service {service.name_lower}",
)