mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-06 19:01:54 +00:00
- Move iter_role_images + all helpers + ImageRef from cli/mirror/util.py and
cli/mirror/model.py into utils/docker/image_discovery.py; add source_file field
to ImageRef to distinguish config/main.yml vs vars/main.yml entries
- Delete cli/mirror/util.py; update all callers to import from utils.docker.image_discovery
- Move utils into subpackages: utils/docker/ (image_ref, paths_utils, hadolint) and
utils/roles/ (dependency_resolver, resource_validation); update all imports
- Reorganise tests into subpackages: tests/lint/docker/dockerfile/, tests/integration/docker/,
tests/unit/utils/docker/, tests/unit/utils/roles/; fix parents[N] offsets after relocation
- tests/lint/docker/test_image_versions.py now uses iter_role_images (same SPOT as mirror)
- Add vars/main.yml images.<name>.{image,version} support for non-application roles
(test-e2e-playwright, sys-ctl-hlth-csp); eliminate hardcoded duplicates in defaults/tasks
- Add web-app-matrix matrix-chatgpt-bot and web-app-mini-qr mini-qr entries in config/main.yml;
replace hardcoded image strings in vars/templates with lookup('config', ...) references
- Fix sync/__main__.py log line to use correct registry prefix for non-Docker-Hub images
- Update docs/contributing/code/role/dockerfile.md with image declaration rules and SPOT reference
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
31 lines
1021 B
Python
31 lines
1021 B
Python
# utils/docker/paths_utils.py
|
|
from __future__ import annotations
|
|
|
|
from utils.entity_name_utils import get_entity_name
|
|
|
|
|
|
def get_docker_paths(application_id: str, path_docker_compose_instances: str) -> dict:
|
|
"""
|
|
Build the compose dict based on path_docker_compose_instances and application_id.
|
|
Uses get_entity_name to extract the entity name from application_id.
|
|
"""
|
|
entity = get_entity_name(application_id)
|
|
base = f"{path_docker_compose_instances}{entity}/"
|
|
|
|
return {
|
|
"directories": {
|
|
"instance": base,
|
|
"env": f"{base}.env/",
|
|
"services": f"{base}services/",
|
|
"volumes": f"{base}volumes/",
|
|
"config": f"{base}config/",
|
|
},
|
|
"files": {
|
|
"env": f"{base}.env/env",
|
|
"compose": f"{base}compose.yml",
|
|
"compose_override": f"{base}compose.override.yml",
|
|
"compose_ca_override": f"{base}compose.ca.override.yml",
|
|
"dockerfile": f"{base}Dockerfile",
|
|
},
|
|
}
|