Ejemplo n.º 1
0
    def Args(parser):
        """Register flags for this command.

    Args:
      parser: An argparse.ArgumentParser-like object.
    """

        flag_config = trigger_utils.AddTriggerArgs(parser)
        trigger_utils.AddBuildConfigArgs(flag_config)
        trigger_utils.AddGitRepoSource(flag_config)
        trigger_utils.AddFilterArg(flag_config)
    def Args(parser):
        """Register flags for this command.

    Args:
      parser: An argparse.ArgumentParser-like object.
    """

        flag_config = trigger_utils.AddTriggerArgs(parser)
        flag_config.add_argument(
            '--topic',
            help='The topic to which this trigger should subscribe.',
            required=True)
        trigger_utils.AddBuildConfigArgs(flag_config)
        trigger_utils.AddGitRepoSource(flag_config)
        trigger_utils.AddFilterArg(flag_config)
Ejemplo n.º 3
0
    def Args(parser):
        """Register flags for this command.

    Args:
      parser: An argparse.ArgumentParser-like object.
    """

        flag_config = trigger_utils.AddTriggerArgs(parser)
        flag_config.add_argument(
            '--secret',
            help=
            'The full path of the secret version required to validate webhook requests against this trigger. For example, projects/my-project/secrets/my-secret/versions/1.',
            required=True)
        trigger_utils.AddBuildConfigArgs(flag_config)
        trigger_utils.AddGitRepoSource(flag_config)
        trigger_utils.AddFilterArg(flag_config)
Ejemplo n.º 4
0
    def Args(parser):
        """Register flags for this command.

    Args:
      parser: An argparse.ArgumentParser-like object. It is mocked out in order
        to capture some information, but behaves like an ArgumentParser.
    """
        messages = cloudbuild_util.GetMessagesModule()
        flag_config = trigger_utils.AddTriggerArgs(parser)
        flag_config.add_argument('--repo-slug',
                                 help='Bitbucket Server repository slug.',
                                 required=True)
        flag_config.add_argument('--project-key',
                                 help='Bitbucket Server project key.',
                                 required=True)
        flag_config.add_argument('--bitbucket-server-config-resource',
                                 help='Bitbucket Server config resource name.',
                                 required=True)
        ref_config = flag_config.add_mutually_exclusive_group(required=True)
        trigger_utils.AddBranchPattern(ref_config)
        trigger_utils.AddTagPattern(ref_config)
        pr_config = ref_config.add_argument_group(help='Pull Request settings')
        pr_config.add_argument('--pull-request-pattern',
                               metavar='REGEX',
                               required=True,
                               help="""\
Regular expression specifying which base git branch to match for
pull request events.

This pattern is used as a regex search for the base branch (the branch you are
trying to merge into) for pull request updates.
For example, --pull-request-pattern=foo will match "foo", "foobar", and "barfoo".

The syntax of the regular expressions accepted is the syntax accepted by
RE2 and described at https://github.com/google/re2/wiki/Syntax.
""")
        pr_config.add_argument(
            '--comment-control',
            default=messages.PullRequestFilter.CommentControlValueValuesEnum.
            COMMENTS_ENABLED,
            help=
            'Require a repository collaborator or owner to comment \'/gcbrun\' on a pull request before running the build.'
        )

        trigger_utils.AddBuildConfigArgs(flag_config)
        trigger_utils.AddRepoEventArgs(flag_config)
Ejemplo n.º 5
0
    def Args(parser):
        """Register flags for this command.

    Args:
      parser: An argparse.ArgumentParser-like object. It is mocked out in order
        to capture some information, but behaves like an ArgumentParser.
    """

        flag_config = trigger_utils.AddTriggerArgs(parser)
        repo_spec = presentation_specs.ResourcePresentationSpec(
            '--repo',  # This defines how the "anchor" or leaf argument is named.
            repo_resource.GetRepoResourceSpec(),
            'Cloud Source Repository.',
            required=True,
            prefixes=False)
        concept_parsers.ConceptParser([repo_spec]).AddToParser(flag_config)
        ref_config = flag_config.add_mutually_exclusive_group(required=True)
        trigger_utils.AddBranchPattern(ref_config)
        trigger_utils.AddTagPattern(ref_config)

        trigger_utils.AddBuildConfigArgs(flag_config)