Documentation
¶
Overview ¶
Package settings provides the defined settings CLI command for Vela.
Usage:
import "github.com/go-vela/cli/command/settings"
Index ¶
Constants ¶
View Source
const ( CompilerCloneImageKey = "compiler.clone-image" CompilerTemplateDepthKey = "compiler.template-depth" CompilerStarlarkExecLimitKey = "compiler.starlark-exec-limit" QueueRouteAddKey = "queue.add-route" QueueRouteDropKey = "queue.drop-route" RepoAllowlistAddKey = "add-repo" RepoAllowlistDropKey = "drop-repo" ScheduleAllowAddlistKey = "add-schedule" ScheduleAllowDroplistKey = "drop-schedule" )
Variables ¶
View Source
var CommandUpdate = &cli.Command{ Name: "settings", Description: "(Platform Admin Only) Use this command to update settings.", Usage: "Update settings from the provided configuration", Action: update, Flags: []cli.Flag{ &cli.StringSliceFlag{ EnvVars: []string{"VELA_QUEUE_ADD_ROUTES", "QUEUE_ADD_ROUTES"}, Name: QueueRouteAddKey, Aliases: []string{"queue-route", "add-route", "routes", "route", "r"}, Usage: "list of routes to add to the queue", }, &cli.StringSliceFlag{ EnvVars: []string{"VELA_QUEUE_DROP_ROUTES", "QUEUE_DROP_ROUTES"}, Name: QueueRouteDropKey, Aliases: []string{"drop-route"}, Usage: "list of routes to drop from the queue", }, &cli.IntFlag{ EnvVars: []string{"VELA_COMPILER_TEMPLATE_DEPTH", "VELA_TEMPLATE_DEPTH", "TEMPLATE_DEPTH"}, Name: CompilerTemplateDepthKey, Aliases: []string{"templates", "template-depth", "templatedepth", "td"}, Usage: "max template depth for the compiler", }, &cli.StringFlag{ EnvVars: []string{"VELA_COMPILER_CLONE_IMAGE", "COMPILER_CLONE_IMAGE"}, Name: CompilerCloneImageKey, Aliases: []string{"clone", "clone-image", "cloneimage", "ci"}, Usage: "image used to clone the repository for the compiler", }, &cli.IntFlag{ EnvVars: []string{"VELA_COMPILER_STARLARK_EXEC_LIMIT", "COMPILER_STARLARK_EXEC_LIMIT"}, Name: CompilerStarlarkExecLimitKey, Aliases: []string{"starlark-exec-limit", "starklark-limit", "starlarklimit", "sel"}, Usage: "max starlark execution limit for the compiler", }, &cli.StringSliceFlag{ EnvVars: []string{"VELA_REPO_ALLOWLIST_ADD_REPOS", "REPO_ALLOWLIST_ADD_REPOS"}, Name: RepoAllowlistAddKey, Aliases: []string{"repo", "repos", "ral"}, Usage: "the list of repositories to add to the list of all those permitted to use Vela", }, &cli.StringSliceFlag{ EnvVars: []string{"VELA_REPO_ALLOWLIST_DROP_REPOS", "REPO_ALLOWLIST_DROP_REPOS"}, Name: RepoAllowlistDropKey, Usage: "the list of repositories to drop from the list of all those permitted to use Vela", }, &cli.StringSliceFlag{ EnvVars: []string{"VELA_SCHEDULE_ALLOWLIST_ADD_REPOS", "SCHEDULE_ALLOWLIST_ADD_REPOS"}, Name: ScheduleAllowAddlistKey, Aliases: []string{"schedule", "schedules", "sal"}, Usage: "the list of repositories to add to the list of all those permitted to use schedules in Vela", }, &cli.StringSliceFlag{ EnvVars: []string{"VELA_SCHEDULE_ALLOWLIST_DROP_REPOS", "SCHEDULE_ALLOWLIST_DROP_REPOS"}, Name: ScheduleAllowDroplistKey, Usage: "the list of repositories to drop from the list of all those permitted to use schedules in Vela", }, &cli.StringFlag{ EnvVars: []string{"VELA_FILE", "SETTINGS_FILE"}, Name: "file", Aliases: []string{"f"}, Usage: "provide a file to update settings", }, &cli.StringFlag{ EnvVars: []string{"VELA_OUTPUT", "SETTINGS_OUTPUT"}, Name: internal.FlagOutput, Aliases: []string{"op"}, Usage: "format the output in json, spew or yaml", Value: "yaml", }, }, CustomHelpTemplate: fmt.Sprintf(`%s EXAMPLES: 1. Update settings to change the compiler clone image to target/vela-git:latest. $ {{.HelpName}} --compiler.clone-image target/vela-git:latest 2. Update settings to change the compiler template depth to 2. $ {{.HelpName}} --compiler.template-depth 2 3. Update settings to change the compiler starlark exec limit to 5. $ {{.HelpName}} --compiler.starlark-exec-limit 5 4. Update settings with additional queue routes. $ {{.HelpName}} --queue.add-route large --queue.add-route small 5. Update settings by dropping queue routes. $ {{.HelpName}} --queue.drop-route large --queue.drop-route small 6. Update settings with additional repos permitted to use Vela (patterns containing * wildcards must be wrapped in quotes on the commandline). $ {{.HelpName}} --add-repo octocat/hello-world --add-repo 'octocat/*' 7. Update settings with additional repos permitted to use schedules in Vela (patterns containing * wildcards must be wrapped in quotes on the commandline). $ {{.HelpName}} --add-schedule octocat/hello-world --schedule 'octocat/*' 8. Update settings from a file. $ {{.HelpName}} --file settings.yml DOCUMENTATION: https://go-vela.github.io/docs/reference/cli/settings/update/ `, cli.CommandHelpTemplate), }
CommandUpdate defines the command for modifying a settings.
View Source
var CommandView = &cli.Command{ Name: "settings", Description: "Use this command to view platform settings.", Usage: "View details for platform settings", Aliases: []string{"platform"}, Action: view, Flags: []cli.Flag{ &cli.StringFlag{ EnvVars: []string{"VELA_OUTPUT", "SETTINGS_OUTPUT"}, Name: internal.FlagOutput, Aliases: []string{"op"}, Usage: "format the output in json, spew or yaml", Value: "yaml", }, }, CustomHelpTemplate: fmt.Sprintf(`%s EXAMPLES: 1. View platform settings. $ {{.HelpName}} DOCUMENTATION: https://go-vela.github.io/docs/reference/cli/settings/view/ `, cli.CommandHelpTemplate), }
CommandView defines the command for inspecting the platform settings record.
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.