Files
computer-playbook/cli/meta/ci/image_ref.py
T
kevinveenbirkenbachandClaude Opus 5 efaed0dbb9 refactor(images): drop the pkgmgr image reference nothing builds any more
962c3d550d made the images build FROM the distribution base, which left the pkgmgr reference in the distro matrix without a producer: utils.distros still rendered it, the image-ref CLI still offered it as a kind, and no caller asked for either.

The requirements-archive target goes with them as the last build-path use of pkgmgr; its alias follows. The pkgmgr-install role is a different thing, installs tools on the target host, and stays where the deprecation lint can keep pointing at pip.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-10-03 21:48:47 +02:00

51 lines
1.5 KiB
Python

"""Render a distro image reference from the ``meta/distros.yml`` SPOT.
Exists so shell and workflow steps can compose the same reference the env
layer composes, instead of spelling ``ghcr.io/...`` out a second time.
python3 -m cli.meta.ci.image_ref --kind environment \\
--distro debian --owner acme --repository infinito-nexus --tag ci-abc
"""
from __future__ import annotations
import argparse
import sys
from utils.distros import IMAGE_ENVIRONMENT, environment_image
def main(argv: list[str] | None = None) -> int:
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument(
"--kind",
required=True,
choices=(IMAGE_ENVIRONMENT,),
help="Which image reference to render.",
)
parser.add_argument("--distro", required=True, help="Distro id, e.g. debian.")
parser.add_argument("--owner", required=True, help="Registry owner.")
parser.add_argument("--tag", required=True, help="Image tag.")
parser.add_argument(
"--repository",
default="",
help="Repository name; required for --kind environment.",
)
args = parser.parse_args(argv)
if not args.repository:
parser.error("--repository is required for --kind environment")
print(
environment_image(
args.distro,
owner=args.owner,
repository=args.repository,
tag=args.tag,
)
)
return 0
if __name__ == "__main__":
sys.exit(main())