Allow aliases in the 'packit copr-build'
@@ -28,6 +28,7 @@ import click
from packit.cli.types import LocalProjectParameter
from packit.cli.utils import cover_packit_exception, get_packit_api
from packit.config import pass_config, get_context_settings
+from packit.config.aliases import get_build_targets
@click.command("copr-build", context_settings=get_context_settings())
@@ -68,9 +69,14 @@ def copr_build(
"""
api = get_packit_api(config=config, local_project=path_or_url)
default_project_name = f"packit-cli-{path_or_url.repo_name}-{path_or_url.ref}"
+
+ targets_to_build = get_build_targets(
+ *targets.split(","), default="fedora-rawhide-x86_64"
+ )
+
build_id, repo_url = api.run_copr_build(
project=project or default_project_name,
- chroots=targets.split(","),
+ chroots=list(targets_to_build),
owner=owner,
description=description,
instructions=instructions,
