func Command()

in hack/operatorhub/cmd/bundle/bundle.go [17:87]


func Command() *cobra.Command {
	bundleCmd := &cobra.Command{
		Use:   "bundle",
		Short: "create pull requests for new operator versions",
		Long: `Bundle and build operator metadata for publishing on openshift operator hub, and create pull requests to
certified-operators, and community-operators repositories.`,
		SilenceUsage: true,
	}

	createPRCmd := &cobra.Command{
		Use:   "create-pr",
		Short: "create pull requests against community and certified repositories",
		Long: `Create pull requests using output of 'bundle' command against
certified-operators and community-operators repositories.`,
		SilenceUsage: true,
		PreRunE:      createPRPreRunE,
		RunE:         doCreatePR,
	}

	bundleCmd.PersistentFlags().StringVarP(
		&flags.Dir,
		flags.DirFlag,
		"d",
		"./",
		"directory containing output from 'operatorhub command' which contains 'certified-operators', and 'community-operators' subdirectories. (OHUB_DIR)",
	)

	createPRCmd.Flags().StringVarP(
		&flags.GithubToken,
		flags.GithubTokenFlag,
		"g",
		"",
		"if 'dry-run' isn't set, user's token to communicate with github.com (OHUB_GITHUB_TOKEN)",
	)

	createPRCmd.Flags().StringVarP(
		&flags.GithubUsername,
		flags.GithubUsernameFlag,
		"u",
		"",
		"if 'dry-run' isn't set, github username to use to fork repositories, and submit PRs (OHUB_GITHUB_USERNAME)",
	)

	createPRCmd.Flags().StringVarP(
		&flags.GithubFullname,
		flags.GithubFullnameFlag,
		"f",
		"",
		"if 'dry-run' isn't set, github full name to use to add to commit message (OHUB_GITHUB_FULLNAME)",
	)

	createPRCmd.Flags().StringVarP(
		&flags.GithubEmail,
		flags.GithubEmailFlag,
		"e",
		"",
		"if 'dry-run' isn't set, github email to use to add to commit message (OHUB_GITHUB_EMAIL)",
	)

	createPRCmd.Flags().BoolVarP(
		&flags.DeleteTempDirectory,
		flags.DeleteTempDirectoryFlag,
		"D",
		true,
		"delete git temporary directory after script completes (OHUB_DELETE_TEMP_DIRECTORY)",
	)

	bundleCmd.AddCommand(createPRCmd)

	return bundleCmd
}