config

package
v0.4.0-rc1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var GenCmd = cli.Command{
	Name:        "config",
	Description: "Use this command to add a config file.",
	Usage:       "Generate a config yaml in a directory",
	Action:      gen,
	Flags: []cli.Flag{
		&cli.StringFlag{
			Name:  "addr",
			Usage: "location of vela server",
		},
		&cli.StringFlag{
			Name:  "token",
			Usage: "User token for Vela server",
		},
		&cli.StringFlag{
			Name:  "api-version",
			Usage: "api version to use for Vela server",
		},
		&cli.StringFlag{
			Name:  "log-level",
			Usage: "set log level - options: (trace|debug|info|warn|error|fatal|panic)",
		},
		&cli.StringFlag{
			Name:  "org",
			Usage: "Provide the organization for the repository",
		},
		&cli.StringFlag{
			Name:  "repo",
			Usage: "Provide the repository contained within the organization",
		},
		&cli.StringFlag{
			Name:  "secret-engine",
			Usage: "Provide the engine for where the secret to be stored",
		},
		&cli.StringFlag{
			Name:  "secret-type",
			Usage: "Provide the kind of secret to be stored",
		},
	},
	CustomHelpTemplate: fmt.Sprintf(`%s
EXAMPLES:
 1. Generate CLI config from environment.
    $ {{.HelpName}}
 2. Generate CLI config with address and token.
    $ {{.HelpName}} --addr https://vela.example.com --token fakeToken
 3. Generate CLI config with specific API version.
    $ {{.HelpName}} --api-version v1
 4. Generate CLI config with debug log level.
    $ {{.HelpName}} --log-level debug
`, cli.CommandHelpTemplate),
}

GenCmd defines the command for creating a configuration file.

View Source
var RemoveCmd = cli.Command{
	Name:        "config",
	Description: "Use this command to remove a field or all fields in the config file.",
	Usage:       "Remove a field or all fields in the config file.",
	Action:      remove,
	Flags: []cli.Flag{
		&cli.BoolFlag{
			Name:  "addr",
			Usage: "removes the addr field from the config",
		},
		&cli.BoolFlag{
			Name:  "token",
			Usage: "removes the token field from the config",
		},
		&cli.BoolFlag{
			Name:  "api-version",
			Usage: "removes the api-version field from the config",
		},
		&cli.BoolFlag{
			Name:  "log-level",
			Usage: "removes the log-level field from the config",
		},
		&cli.BoolFlag{
			Name:  "org",
			Usage: "removes the org field from the config",
		},
		&cli.BoolFlag{
			Name:  "repo",
			Usage: "removes the repo field from the config",
		},
		&cli.BoolFlag{
			Name:  "secret-engine",
			Usage: "removes the secret-engine field from the config",
		},
		&cli.BoolFlag{
			Name:  "secret-type",
			Usage: "removes the secret-type field from the config",
		},
	},
	CustomHelpTemplate: fmt.Sprintf(`%s
EXAMPLES:
 1. Remove the CLI config file.
    $ {{.HelpName}}
 2. Remove the address from the CLI config file.
    $ {{.HelpName}} --address
 3. Remove the API version from the CLI config file.
    $ {{.HelpName}} --api-version
 4. Remove the log level from the CLI config file.
    $ {{.HelpName}} --log-level
`, cli.CommandHelpTemplate),
}

RemoveCmd defines the command for deleting a configuration file.

View Source
var UpdateCmd = cli.Command{
	Name:        "config",
	Description: "Use this command to update a config file.",
	Usage:       "Update a config file",
	Action:      update,
	Flags: []cli.Flag{
		&cli.StringFlag{
			Name:  "addr",
			Usage: "location of vela server",
		},
		&cli.StringFlag{
			Name:  "token",
			Usage: "User token for Vela server",
		},
		&cli.StringFlag{
			Name:  "api-version",
			Usage: "api version to use for Vela server",
		},
		&cli.StringFlag{
			Name:  "log-level",
			Usage: "set log level - options: (trace|debug|info|warn|error|fatal|panic)",
		},
		&cli.StringFlag{
			Name:  "org",
			Usage: "Provide the organization for the repository",
		},
		&cli.StringFlag{
			Name:  "repo",
			Usage: "Provide the repository contained within the organization",
		},
		&cli.StringFlag{
			Name:  "secret-engine",
			Usage: "Provide the engine for where the secret to be stored",
		},
		&cli.StringFlag{
			Name:  "secret-type",
			Usage: "Provide the kind of secret to be stored",
		},
	},
	CustomHelpTemplate: fmt.Sprintf(`%s
EXAMPLES:
 1. Update CLI config with address.
    $ {{.HelpName}} --addr https://vela.example.com
 2. Update CLI config with personal token.
    $ {{.HelpName}} --token fakeToken
 3. Update CLI config with specific API version.
    $ {{.HelpName}} --api-version v1
 4. Update CLI config with debug log level.
    $ {{.HelpName}} --log-level debug
`, cli.CommandHelpTemplate),
}

UpdateCmd defines the command for updating a configuration file.

View Source
var ViewCmd = cli.Command{
	Name:        "config",
	Description: "Use this command to view a config file.",
	Usage:       "View details of the provided config file",
	Action:      view,
	CustomHelpTemplate: fmt.Sprintf(`%s
EXAMPLES:
 1. View CLI config.
    $ {{.HelpName}}
`, cli.CommandHelpTemplate),
}

ViewCmd defines the command for viewing a configuration file.

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