Be able to set copr-project options via CLI
--list-on-homepage
--preserve-project
--additional_repos
# SOFTWARE.
import logging
import os
+from typing import Optional, List
import click
@@ -57,6 +58,27 @@ logger = logging.getLogger(__name__)
help="Installation instructions for the project to build in.",
default=None,
)
+@click.option(
+ "--list-on-homepage",
+ help="Created copr project will be visible on copr's home-page.",
+ default=False,
+ is_flag=True,
+)
+@click.option(
+ "--preserve-project",
+ help="Created copr project will not be removed after 60 days.",
+ default=False,
+ is_flag=True,
+)
+@click.option(
+ "--additional-repos",
+ help="URLs to additional yum repos, which can be used during build. "
+ "Comma separated. "
+ "This should be baseurl from .repo file. "
+ "E.g.: http://copr-be.cloud.fedoraproject.org/"
+ "results/rhughes/f20-gnome-3-12/fedora-$releasever-$basearch/",
+ default=None,
+)
@click.option(
"--upstream-ref",
default=None,
@@ -75,7 +97,10 @@ def copr_build(
targets,
description,
instructions,
+ list_on_homepage,
+ preserve_project,
upstream_ref,
+ additional_repos,
path_or_url,
):
"""
@@ -96,6 +121,10 @@ def copr_build(
*targets.split(","), default="fedora-rawhide-x86_64"
)
+ additional_repos_list: Optional[List[str]] = additional_repos.split(
+ ","
+ ) if additional_repos else None
+
build_id, repo_url = api.run_copr_build(
project=project,
chroots=list(targets_to_build),
@@ -103,6 +132,9 @@ def copr_build(
description=description,
instructions=instructions,
upstream_ref=upstream_ref,
+ list_on_homepage=list_on_homepage,
+ preserve_project=preserve_project,
+ additional_repos=additional_repos_list,
)
click.echo(f"Build id: {build_id}, repo url: {repo_url}")
if not nowait:
