repo

package
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 1, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AddCmd = cli.Command{
	Name:        "repo",
	Description: "Use this command to add a repository.",
	Usage:       "Add a repository",
	Action:      add,
	Before:      validate,
	Flags: []cli.Flag{

		&cli.StringFlag{
			Name:    "org",
			Usage:   "Provide the organization for the repository",
			EnvVars: []string{"REPO_ORG"},
		},
		&cli.StringFlag{
			Name:    "repo",
			Usage:   "Provide the repository contained with the organization",
			EnvVars: []string{"REPO_NAME"},
		},

		&cli.StringFlag{
			Name:    "link",
			Usage:   "Link to repository in source control",
			EnvVars: []string{"REPO_LINK"},
		},
		&cli.StringFlag{
			Name:    "clone",
			Usage:   "Clone link to repository in source control",
			EnvVars: []string{"REPO_CLONE"},
		},
		&cli.Int64Flag{
			Name:    "timeout",
			Usage:   "Allow management of timeouts",
			EnvVars: []string{"REPO_TIMEOUT"},
			Value:   60,
		},
		&cli.BoolFlag{
			Name:    "private",
			Usage:   "Allow management of private repositories",
			EnvVars: []string{"REPO_PRIVATE"},
		},
		&cli.BoolFlag{
			Name:    "trusted",
			Usage:   "Allow management of trusted repositories",
			EnvVars: []string{"REPO_TRUSTED"},
		},
		&cli.BoolFlag{
			Name:    "active",
			Usage:   "Allow management of activity on repositories",
			EnvVars: []string{"REPO_ACTIVE"},
			Value:   true,
		},
		&cli.StringSliceFlag{
			Name:    "event",
			Usage:   "Allow management of the repository trigger events",
			EnvVars: []string{"REPO_EVENT"},
			Value:   &cli.StringSlice{},
		},
	},
	CustomHelpTemplate: fmt.Sprintf(`%s
EXAMPLES:
 1. Add a repository with push and pull request enabled.
    $ {{.HelpName}} --org github --repo octocat --event push --event pull_request
 2. Add a repository with all event types enabled.
    $ {{.HelpName}} --org github --repo octocat --event push --event pull_request --event tag --event deployment --event comment
 3. Add a repository with a longer build timeout.
    $ {{.HelpName}} --org github --repo octocat --timeout 90
 4. Add a repository with push and pull request enabled when org and repo config or environment variables are set.
    $ {{.HelpName}} --event push --event pull_request
`, cli.CommandHelpTemplate),
}

AddCmd defines the command for adding a repository.

View Source
var GetCmd = cli.Command{
	Name:        "repo",
	Aliases:     []string{"repos"},
	Description: "Use this command to get a list of repositories.",
	Usage:       "Display a list of repositories",
	Action:      get,
	Flags: []cli.Flag{

		&cli.IntFlag{
			Name:    "page",
			Aliases: []string{"p"},
			Usage:   "Print a specific page of repos",
			Value:   1,
		},
		&cli.IntFlag{
			Name:    "per-page",
			Aliases: []string{"pp"},
			Usage:   "Expand the number of items contained within page",
			Value:   10,
		},
		&cli.StringFlag{
			Name:    "output",
			Aliases: []string{"o"},
			Usage:   "Print the output in wide, yaml or json format",
		},
	},
	CustomHelpTemplate: fmt.Sprintf(`%s
EXAMPLES:
 1. Get repositories.
    $ {{.HelpName}}
 2. Get repositories with wide view output.
    $ {{.HelpName}} --output wide
 3. Get repositories with yaml output.
    $ {{.HelpName}} --output yaml
 4. Get repositories with json output.
    $ {{.HelpName}} --output json
`, cli.CommandHelpTemplate),
}

GetCmd defines the command for getting a list of repositories.

View Source
var RemoveCmd = cli.Command{
	Name:        "repo",
	Description: "Use this command to remove a repository.",
	Usage:       "Remove a repository",
	Action:      remove,
	Before:      validate,
	Flags: []cli.Flag{

		&cli.StringFlag{
			Name:    "org",
			Usage:   "Provide the organization for the repository",
			EnvVars: []string{"REPO_ORG"},
		},
		&cli.StringFlag{
			Name:    "repo",
			Usage:   "Provide the repository contained with the organization",
			EnvVars: []string{"REPO_NAME"},
		},
	},
	CustomHelpTemplate: fmt.Sprintf(`%s
EXAMPLES:
 1. Remove a repository.
    $ {{.HelpName}} --org github --repo octocat
 2. Remove a repository when org and repo config or environment variables are set.
    $ {{.HelpName}}
`, cli.CommandHelpTemplate),
}

RemoveCmd defines the command for deleting a repository.

View Source
var UpdateCmd = cli.Command{
	Name:        "repo",
	Description: "Use this command to update a repository.",
	Usage:       "Update a repository",
	Action:      update,
	Before:      validate,
	Flags: []cli.Flag{

		&cli.StringFlag{
			Name:    "org",
			Usage:   "Provide the organization for the repository",
			EnvVars: []string{"REPO_ORG"},
		},
		&cli.StringFlag{
			Name:    "repo",
			Usage:   "Provide the repository contained with the organization",
			EnvVars: []string{"REPO_NAME"},
		},

		&cli.StringFlag{
			Name:    "link",
			Usage:   "Link to repository in source control",
			EnvVars: []string{"REPO_LINK"},
		},
		&cli.StringFlag{
			Name:    "clone",
			Usage:   "Clone link to repository in source control",
			EnvVars: []string{"REPO_CLONE"},
		},
		&cli.Int64Flag{
			Name:    "timeout",
			Usage:   "Allow management of timeouts",
			EnvVars: []string{"REPO_TIMEOUT"},
			Value:   60,
		},
		&cli.BoolFlag{
			Name:    "private",
			Usage:   "Allow management of private repositories",
			EnvVars: []string{"REPO_PRIVATE"},
		},
		&cli.BoolFlag{
			Name:    "trusted",
			Usage:   "Allow management of trusted repositories",
			EnvVars: []string{"REPO_TRUSTED"},
		},
		&cli.BoolFlag{
			Name:    "active",
			Usage:   "Allow management of activity on repositories",
			EnvVars: []string{"REPO_ACTIVE"},
			Value:   true,
		},
		&cli.StringSliceFlag{
			Name:    "event",
			Usage:   "Allow management of the repository trigger events",
			EnvVars: []string{"REPO_EVENT"},
			Value:   &cli.StringSlice{},
		},
	},
	CustomHelpTemplate: fmt.Sprintf(`%s
EXAMPLES:
 1. Update a repository.
    $ {{.HelpName}} --org github --repo octocat
 2. Update a repository with all event types enabled.
    $ {{.HelpName}} --org github --repo octocat --event push --event pull_request --event tag --event deployment --event comment
 3. Update a repository with a longer build timeout.
    $ {{.HelpName}} --org github --repo octocat --timeout 90
 4. Update a repository when org and repo config or environment variables are set.
    $ {{.HelpName}}
`, cli.CommandHelpTemplate),
}

UpdateCmd defines the command to update a repository.

View Source
var ViewCmd = cli.Command{
	Name:        "repo",
	Description: "Use this command to view a repository.",
	Usage:       "View details of the provided repository",
	Action:      view,
	Before:      validate,
	Flags: []cli.Flag{

		&cli.StringFlag{
			Name:    "org",
			Usage:   "Provide the organization for the repository",
			EnvVars: []string{"REPO_ORG"},
		},
		&cli.StringFlag{
			Name:    "repo",
			Usage:   "Provide the repository contained with the organization",
			EnvVars: []string{"REPO_NAME"},
		},

		&cli.StringFlag{
			Name:    "output",
			Aliases: []string{"o"},
			Usage:   "Print the output in json format",
		},
	},
	CustomHelpTemplate: fmt.Sprintf(`%s
EXAMPLES:
 1. View repository details.
    $ {{.HelpName}} --org github --repo octocat
 2. View repository details with json output.
    $ {{.HelpName}} --org github --repo octocat --output json
 3. View repository details when org and repo config or environment variables are set.
    $ {{.HelpName}}
`, cli.CommandHelpTemplate),
}

ViewCmd defines the command for viewing a repository.

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL