def init_argparser(self, parser, defaults): super(PublishHalyardCommandFactory, self).init_argparser( parser, defaults) GradleCommandFactory.add_bom_parser_args(parser, defaults) SpinnakerSourceCodeManager.add_parser_args(parser, defaults) GradleRunner.add_parser_args(parser, defaults) GitRunner.add_publishing_parser_args(parser, defaults) HalRunner.add_parser_args(parser, defaults) self.add_argument( parser, 'build_number', defaults, DEFAULT_BUILD_NUMBER, help='Publishing halyard requires a rebuild. This is the build number' ' to use when rebuilding halyard.') self.add_argument( parser, 'halyard_version', defaults, None, help='The semantic version of the release to publish.') self.add_argument( parser, 'halyard_version_commits_url', defaults, None, help='URL to file containing version and git commit for successful' ' nightly builds. By default this will be' ' "{filename}" in the' ' --halyard_bucket_base_url.'.format( filename=BuildHalyardCommand.HALYARD_VERSIONS_BASENAME)) self.add_argument( parser, 'halyard_docker_image_base', defaults, None, help='Base Docker image name for writing halyard builds.') self.add_argument( parser, 'halyard_bucket_base_url', defaults, None, help='Base Google Cloud Storage URL for writing halyard builds.') self.add_argument(parser, 'docs_repo_owner', defaults, None, help='Owner of the docs repo if one was' ' specified. The default is --github_owner.') self.add_argument( parser, 'skip_existing', defaults, False, type=bool, help='Skip builds if the desired version already exists on bintray.') self.add_argument( parser, 'delete_existing', defaults, None, type=bool, help='Delete pre-existing desired versions if from bintray.') self.add_argument( parser, 'gcb_project', defaults, None, help='The GCP project ID when using the GCP Container Builder.') self.add_argument( parser, 'gcb_service_account', defaults, None, help='Google Service Account when using the GCP Container Builder.') self.add_argument( parser, 'artifact_registry', defaults, None, help='Artifact registry to push the container images to.')
def add_parser_args(parser, defaults): """Add standard parser arguments used by SourceCodeManager.""" if hasattr(parser, 'added_branch_scm'): return parser.added_branch_scm = True SpinnakerSourceCodeManager.add_parser_args(parser, defaults) GitRunner.add_parser_args(parser, defaults) add_parser_argument(parser, 'git_branch', defaults, None, help='The git branch to operate on.') add_parser_argument(parser, 'github_hostname', defaults, 'github.com', help='The hostname of the git server.')
def add_parser_args(parser, defaults): """Add standard parser arguments used by SourceCodeManager.""" if hasattr(parser, 'added_bom_scm'): return parser.added_bom_scm = True SpinnakerSourceCodeManager.add_parser_args(parser, defaults) HalRunner.add_parser_args(parser, defaults) add_parser_argument( parser, 'bom_path', defaults, None, help='Use the sources specified in the BOM path.') add_parser_argument( parser, 'bom_version', defaults, None, help='Use the sources specified in the BOM version.')
def test_foreach_repo(self): test_root = os.path.join(self.base_temp_dir, 'foreach_test') pos_args = [1, 2, 3] kwargs = {'a': 'A', 'b': 'B'} scm = SpinnakerSourceCodeManager(self.options, test_root) all_repos = [scm.make_repository_spec(repo_name, origin=origin) for repo_name, origin in self.ORIGIN_URLS.items()] expect = { repository.name: (repository, pos_args, kwargs) for repository in all_repos } def _foreach_func(repository, *pos_args, **kwargs): return (repository, list(pos_args), dict(kwargs)) got = scm.foreach_source_repository( all_repos, _foreach_func, *pos_args, **kwargs) self.assertEqual(expect, got)
def init_argparser(self, parser, defaults): super(PublishHalyardCommandFactory, self).init_argparser( parser, defaults) GradleCommandFactory.add_bom_parser_args(parser, defaults) SpinnakerSourceCodeManager.add_parser_args(parser, defaults) GradleRunner.add_parser_args(parser, defaults) GitRunner.add_publishing_parser_args(parser, defaults) HalRunner.add_parser_args(parser, defaults) self.add_argument( parser, 'build_number', defaults, DEFAULT_BUILD_NUMBER, help='Publishing halyard requires a rebuild. This is the build number' ' to use when rebuilding halyard.') self.add_argument( parser, 'halyard_version', defaults, None, help='The semantic version of the release to publish.') self.add_argument( parser, 'halyard_version_commits_url', defaults, None, help='URL to file containing version and git commit for successful' ' nightly builds. By default this will be' ' "{filename}" in the' ' --halyard_bucket_base_url.'.format( filename=BuildHalyardCommand.HALYARD_VERSIONS_BASENAME)) self.add_argument( parser, 'halyard_docker_image_base', defaults, None, help='Base Docker image name for writing halyard builds.') self.add_argument( parser, 'halyard_bucket_base_url', defaults, None, help='Base Google Cloud Storage URL for writing halyard builds.') self.add_argument(parser, 'docs_repo_owner', defaults, None, help='Owner of the docs repo if one was' ' specified. The default is --github_owner.') self.add_argument( parser, 'skip_existing', defaults, False, type=bool, help='Skip builds if the desired version already exists on bintray.') self.add_argument( parser, 'delete_existing', defaults, None, type=bool, help='Delete pre-existing desired versions if from bintray.')
def init_argparser(self, parser, defaults): super(PublishHalyardCommandFactory, self).init_argparser(parser, defaults) GradleCommandFactory.add_bom_parser_args(parser, defaults) SpinnakerSourceCodeManager.add_parser_args(parser, defaults) GradleRunner.add_parser_args(parser, defaults) GitRunner.add_publishing_parser_args(parser, defaults) HalRunner.add_parser_args(parser, defaults) self.add_argument( parser, "build_number", defaults, DEFAULT_BUILD_NUMBER, help= "Publishing halyard requires a rebuild. This is the build number" " to use when rebuilding halyard.", ) self.add_argument( parser, "halyard_version", defaults, None, help="The semantic version of the release to publish.", ) self.add_argument( parser, "halyard_version_commits_url", defaults, None, help="URL to file containing version and git commit for successful" " nightly builds. By default this will be" ' "{filename}" in the' " --halyard_bucket_base_url.".format( filename=BuildHalyardCommand.HALYARD_VERSIONS_BASENAME), ) self.add_argument( parser, "halyard_docker_image_base", defaults, None, help="Base Docker image name for writing halyard builds.", ) self.add_argument( parser, "halyard_artifact_registry_image_base", defaults, None, help= "Base Artifact Registry image name for writing halyard builds.", ) self.add_argument( parser, "halyard_bucket_base_url", defaults, None, help="Base Google Cloud Storage URL for writing halyard builds.", ) self.add_argument( parser, "docs_repo_owner", defaults, None, help="Owner of the docs repo if one was" " specified. The default is --github_owner.", ) self.add_argument( parser, "skip_existing", defaults, False, type=bool, help= "Skip builds if the desired version already exists on bintray.", ) self.add_argument( parser, "delete_existing", defaults, None, type=bool, help="Delete pre-existing desired versions if from bintray.", ) self.add_argument( parser, "gcb_project", defaults, None, help="The GCP project ID when using the GCP Container Builder.", ) self.add_argument( parser, "gcb_service_account", defaults, None, help="Google Service Account when using the GCP Container Builder.", ) self.add_argument( parser, "artifact_registry", defaults, None, help="Artifact Registry to push the container images to.", )