示例#1
0
文件: status.py 项目: jlebon/packit
import logging
import os

import click

from packit.cli.types import LocalProjectParameter
from packit.cli.utils import cover_packit_exception
from packit.config import pass_config, get_context_settings
from packit.cli.utils import get_packit_api

logger = logging.getLogger(__file__)


@click.command("status", context_settings=get_context_settings())
@click.argument("path_or_url",
                type=LocalProjectParameter(),
                default=os.path.abspath(os.path.curdir))
@pass_config
@cover_packit_exception
def status(config, path_or_url):
    """
    Display status.

    \b
    - latest downstream pull requests
    - versions from all downstream branches
    - latest upstream releases
    - latest builds in Koji
    - latest updates in Bodhi
    """
示例#2
0
"""
Push Bodhi updates from testing to stable.
"""

import logging
import os

import click

from packit.cli.types import LocalProjectParameter
from packit.cli.utils import cover_packit_exception
from packit.cli.utils import get_packit_api
from packit.config import pass_config, get_context_settings

logger = logging.getLogger(__file__)


@click.command("push-updates", context_settings=get_context_settings())
@click.option("--update-alias", help="For example FEDORA-2019-ee5674e22c", default=None)
@click.argument("path_or_url", type=LocalProjectParameter(), default=os.path.curdir)
@pass_config
@cover_packit_exception
def push_updates(update_alias, config, path_or_url):
    """
    Find all Bodhi updates that have been in testing for more than 'Stable days' (7 by default)
    and push them to stable.

    """
    api = get_packit_api(config=config, local_project=path_or_url)
    api.push_updates(update_alias)
示例#3
0
文件: build.py 项目: yottanami/packit
    help="Target branch in dist-git to release into.",
    default="master",
)
@click.option(
    "--dist-git-path",
    help="Path to dist-git repo to work in. "
    "Otherwise clone the repo in a temporary directory.",
)
@click.option(
    "--koji-target", help="Koji target to build inside (see `koji list-targets`)."
)
@click.option(
    "--scratch", is_flag=True, default=False, help="Submit a scratch koji build"
)
@click.option("--nowait", is_flag=True, default=False, help="Don't wait on build")
@click.argument("path_or_url", type=LocalProjectParameter(), default=getcwd())
@pass_config
@cover_packit_exception
def build(
    config, dist_git_path, dist_git_branch, scratch, nowait, path_or_url, koji_target
):
    """
    Build selected upstream project in Fedora.

    Packit goes to dist-git and performs `fedpkg build` for the selected branch.

    PATH_OR_URL argument is a local path or a URL to the upstream git repository,
    it defaults to the current working directory
    """
    api = get_packit_api(
        config=config, dist_git_path=dist_git_path, local_project=path_or_url
示例#4
0
    is_flag=True,
    default=True,
    help=
    "Specifies whether to merge PR into the base branch in case pr-id is specified.",
)
@click.option(
    "--target-branch",
    default=None,
    type=click.STRING,
    help="Specifies target branch which PR should be merged into.",
)
@click.argument(
    "path_or_url",
    type=LocalProjectParameter(
        ref_param_name="ref",
        pr_id_param_name="pr_id",
        merge_pr_param_name="merge_pr",
        target_branch_param_name="target_branch",
    ),
    default=os.path.curdir,
)
@pass_config
@cover_packit_exception
def prepare_sources(
    config,
    path_or_url,
    job_config,
    upstream_ref,
    bump,
    release_suffix,
    result_dir,
    ref,
示例#5
0
@click.option(
    "--fork/--no-fork",
    is_flag=True,
    default=True,
    help="Push to a fork before creating a pull request.",
)
@click.option(
    "--remote",
    default=None,
    help=(
        "Name of the remote where packit should push. "
        "If this is not specified, push to a fork if the repo can be forked."),
)
@click.argument(
    "path_or_url",
    type=LocalProjectParameter(remote_param_name="remote"),
    default=os.path.abspath(os.path.curdir),
)
@cover_packit_exception
@pass_config
def sync_from_downstream(config, dist_git_branch, upstream_branch, no_pr,
                         path_or_url, fork, remote):
    """
    Copy synced files from Fedora dist-git into upstream by opening a pull request.

    PATH_OR_URL argument is a local path or a URL to the upstream git repository,
    it defaults to the current working directory
    """
    api = get_packit_api(config=config, local_project=path_or_url)
    api.sync_from_downstream(dist_git_branch,
                             upstream_branch,
示例#6
0
文件: update.py 项目: jscotka/packit
    "Otherwise clone the repo in a temporary directory.",
)
@click.option(
    "--local-content",
    is_flag=True,
    default=False,
    help="Do not checkout release tag. Use the current state of the repo.",
)
@click.option(
    "--force-new-sources",
    is_flag=True,
    default=False,
    help="Upload the new sources also when the archive is already in the lookaside cache.",
)
@click.argument(
    "path_or_url", type=LocalProjectParameter(), default=os.path.abspath(os.path.curdir)
)
@click.argument("version", required=False)
@pass_config
@cover_packit_exception
def update(
    config,
    dist_git_path,
    dist_git_branch,
    force_new_sources,
    local_content,
    path_or_url,
    version,
):
    """
    Release current upstream release into Fedora