mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-06 10:59:59 +00:00
Resolve every 3+-file same-prefix group flagged by the new prefix lint
by moving the files into a subfolder named after the shared prefix and
dropping the prefix from the file names, updating all references:
- utils/env/handlers/infinito_*.py -> infinito/ (dir/, package_cache/
nested a second level); registry imports and the four handler-dir
globs switched to iter_project_files
- utils/install/lint/ansible_*.py -> ansible/ (aliased imports)
- roles/sys-svc-compose/files/swarm_*.{py,sh} -> files/swarm/
- web-app-erpnext/web-app-zammad files/scripts/apply_*.{py,rb} -> apply/
- web-app-odoo files/sql/{select,update}-* and sql/oidc/{grant,insert,
select,update}-* -> matching subfolders
- web-app-keycloak tasks/update/05_ldap*.yml -> 05_ldap/ (internal
includes made role_path-absolute)
- plugins/filter/get_*.py -> plugins/filter/get/ (filter names are the
filters() dict keys, so Jinja usage is unaffected; ansible discovers
the one-level-deep subdir)
Ansible lookup dirs, addon dirs and .github/workflows keep their flat
layout (the filename is the public id / GitHub only discovers flat).
Unit tests mirror the new source layout.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
28 lines
991 B
Python
28 lines
991 B
Python
"""INFINITO_CONTAINER: compose service container name derived from
|
|
INFINITO_DISTRO. Always overrides whatever the static-env default was.
|
|
|
|
When COMPOSE_PROJECT_NAME is set to a non-default value (e.g. "runner-1"
|
|
for self-hosted runner instances), the project name is incorporated so
|
|
runner CI jobs don't conflict with the always-running dev container."""
|
|
|
|
from __future__ import annotations
|
|
|
|
from typing import TYPE_CHECKING
|
|
|
|
if TYPE_CHECKING:
|
|
from utils.env.builder import BuildContext, EnvBuilder
|
|
|
|
KEY = "INFINITO_CONTAINER"
|
|
COMMENT = "Compose service container name derived from INFINITO_DISTRO."
|
|
|
|
|
|
def apply(eb: EnvBuilder, ctx: BuildContext) -> None:
|
|
distro = eb.get("INFINITO_DISTRO")
|
|
project = eb.get("COMPOSE_PROJECT_NAME")
|
|
if project and project != "infinito-nexus":
|
|
safe = project.replace("-", "_").replace(".", "_")
|
|
name = f"infinito_{safe}_nexus_{distro}"
|
|
else:
|
|
name = f"infinito_nexus_{distro}"
|
|
eb.set(KEY, name, comment=COMMENT)
|