예제 #1
0
def detect_in_nvr(runtime: Runtime, nvrs, as_yaml, as_json):
    """ Check whether one or more Brew builds have embargoed fixes.

    If neither --yaml nor --json is given, this program will exit with status 0 if true, or with status 2 if not.
    Errors are signaled by a non-zero status that is not 2.

    Example:

        $ doozer --group=openshift-4.6 detect-embargo nvr openshift-4.6.0-202007110420.p1.git.0.4de1d1d.el8 openshift-clients-4.6.0-202007152229.p0.git.3651.9a1d25f.el8
    """
    if as_yaml and as_json:
        raise click.BadParameter("Must use one of --yaml or --json.")
    runtime.initialize(clone_distgits=False)
    embargoed_builds = detect_embargoes_in_nvrs(runtime, nvrs)
    print_result_and_exit(embargoed_builds, None, None, as_yaml, as_json)
예제 #2
0
def detect_in_tag(runtime: Runtime, kind, tags, excluded_tags, event_id,
                  as_yaml, as_json):
    """ Check whether one or more Brew tags have builds that include embargoed fixes.

    If neither --yaml nor --json is given, this program will exit with status 0 if true, or with status 2 if not.
    Errors are signaled by a non-zero status that is not 2.

    Example:
        $ doozer --group=openshift-4.6 detect-embargo tag rhaos-4.6-rhel-8-candidate rhaos-4.6-rhel-7-candidate --exclude rhaos-4.6-rhel-8  --exclude rhaos-4.6-rhel-7
    """
    if as_yaml and as_json:
        raise click.BadParameter("Must use one of --yaml or --json.")
    runtime.initialize(clone_distgits=False)
    embargoed_builds = detect_embargoes_in_tags(runtime, kind, tags,
                                                excluded_tags, event_id)
    print_result_and_exit(embargoed_builds, None, None, as_yaml, as_json)