cmd

package
v0.0.0-...-614ca16 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2023 License: MIT Imports: 85 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ArgSvcToggleLocalhost = "localhost"
	ArgSvcToggleMinikube  = "minikube"
	ArgFilteringAll       = "all"
	ArgFilteringLabels    = "labels"
	ArgAppListDiff        = "diff"
	ArgAppListSkipActual  = "skip-actual"
	ArgAppValueSet        = "value-sets"
	ArgAppSet             = "set"

	ArgAppFromRelease       = "release"
	ArgAppLatest            = "latest"
	ArgAppDeletePurge       = "purge"
	ArgAppCloneDir          = "dir"
	ArgFilteringInclude     = "include"
	ArgFilteringExclude     = "exclude"
	ArgChangeLogMoreDetails = "details"
)
View Source
const (
	ArgE2ERunTests        = "tests"
	ArgE2ERunSkipSetup    = "skip-setup"
	ArgE2ERunSkipTeardown = "skip-teardown"
)
View Source
const (
	ArgEnvCurrent = "current"
	ArgEnvCluster = "cluster"
)
View Source
const (
	ArgPullRequestReviewers = "reviewer"
	ArgPullRequestTitle     = "title"
	ArgPullRequestBody      = "body"
	ArgPullRequestBase      = "base"
)
View Source
const (
	GitRetry             = "retry"
	ArgGitCommitNoVerify = "no-verify"
	ArgGitCommitSquash   = "squash-against"
	TempFileGitCommit    = "/tmp/bosun_git_commit"
)
View Source
const (
	ArgGitTitle          = "title"
	ArgGitBody           = "body"
	ArgGitTaskStory      = "story"
	ArgGitTaskParentOrg  = "parent-org"
	ArgGitTaskParentRepo = "parent-repo"
)
View Source
const (
	ArgGraylogApiOrigin = "api-origin"
	ArgGraylogUsername  = "username"
	ArgGraylogPassword  = "password"
	ArgGraylogValues    = "set"
)
View Source
const (
	OutputTable = "table"
	OutputYaml  = "yaml"
)
View Source
const (
	ArgIssueParent   = "parents"
	ArgIssueChildren = "children"
)
View Source
const (
	ArgKubePullSecretName              = "name"
	ArgKubePullSecretTarget            = "target"
	ArgKubePullSecretUsername          = "username"
	ArgKubePullSecretPassword          = "password"
	ArgKubePullSecretPasswordLpassPath = "password-path"
	ArgKubePullSecretNamespace         = "namespace"
)
View Source
const (
	ArgMetaUpgradePreRelease = "pre-release"
	ArgMetaUpgradeVersion    = "version"
)
View Source
const (
	ArgMongoDatabase        = "mongo-database"
	ArgMongoHost            = "host"
	ArgMongoPort            = "port"
	ArgMongoVaultAuth       = "vault-auth"
	ArgMongoUsername        = "username"
	ArgMongoPassword        = "password"
	ArgMongoAuthSource      = "auth-source"
	ArgMongoKubePortForward = "kube-port-forward"
	ArgMongoKubePort        = "kube-port"
	ArgMongoKubeSvcName     = "kube-service-name"
	ArgMongoRebuildDb       = "rebuild-db"
)
View Source
const (
	ArgReleaseAddBranch = "branch"
	ArgReleaseAddBump   = "bump"
)
View Source
const (
	ArgGlobalSudo          = "sudo"
	ArgGlobalVerbose       = "verbose"
	ArgGlobalTrace         = "trace"
	ArgGlobalVerboseErrors = "verbose-errors"
	ArgGlobalDryRun        = "dry-run"
	ArgGlobalDomain        = "domain"
	ArgGlobalValues        = "values"
	ArgBosunConfigFile     = "config-file"
	ArgGlobalConfirmedEnv  = "confirm-env"
	ArgGlobalNoEnv         = "no-env"
	ArgGlobalNoCluster     = "no-cluster"
	ArgGlobalForce         = "force"
	ArgGlobalNoReport      = "no-report"
	ArgGlobalOutput        = "output"
	ArgGlobalProfile       = "profile"
	ArgGlobalCluster       = "cluster"
)
View Source
const (
	ArgVaultAddr            = "vault-addr"
	ArgVaultToken           = "vault-token"
	ArgVaultJWTRole         = "role"
	ArgVaultJWTTenant       = "tenant"
	ArgVaultJWTSub          = "sub"
	ArgVaultJWTTTL          = "ttl"
	ArgVaultJWTClaims       = "claims"
	ArgVaultSecretGenerate  = "generate"
	ArgVaultSecretOverwrite = "overwrite"
	ArgVaultSecretDefault   = "default"
	ArgVaultNamespace       = "vault-namespace"
)
View Source
const (
	ArgAppBumpTag = "tag"
)
View Source
const (
	ArgAppProviderPriority = "providers"
)
View Source
const ArgAppRecyclePullLatest = "pull-latest"
View Source
const ArgGitAcceptPRAppVersion = "app"
View Source
const (
	ArgImagePattern = "pattern"
)
View Source
const (
	ArgKubeDashboardUrl = "url"
)
View Source
const (
	ArgReleaseName = "release"
)
View Source
const ArgReleaseRecycle = "recycle"
View Source
const ArgReleaseSkipValidate = "skip-validation"
View Source
const (
	ArgReleaseValidateNoProgress = "no-progress"
)
View Source
const (
	ArgScriptSteps = "steps"
)
View Source
const (
	LabelBundleConfigMapHash = "naveego.com/bosun-bundle-hash"
)

Variables

View Source
var (
	ArgPublishChartForce = "force"
)

Functions

func Execute

func Execute()

Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.

func GetStoryHandler

func GetStoryHandler(b *bosun.Bosun, storyID string) (stories.StoryHandler, error)

func MustGetBosun

func MustGetBosun(optionalParams ...cli.Parameters) *bosun.Bosun

func MustGetBosunNoEnvironment

func MustGetBosunNoEnvironment(optionalParams ...cli.Parameters) *bosun.Bosun

func MustGetPlatform

func MustGetPlatform(optionalParams ...cli.Parameters) (*bosun.Bosun, *bosun.Platform)

func MustYaml

func MustYaml(i interface{}) string

func StartFeatureDevelopment

func StartFeatureDevelopment(taskName string, body string, storyID string) error

func TraverseRunHooks

func TraverseRunHooks(c *cobra.Command) *cobra.Command

TraverseRunHooks modifies c's PersistentPreRun* and PersistentPostRun* functions (when present) so that they will search c's command chain and invoke the corresponding hook of the first parent that provides a hook. When used on every command in the chain the invocation of hooks will be propagated up the chain to the root command.

In the case of PersistentPreRun* hooks the parent hook is invoked before the child hook. In the case of PersistentPostRun* the child hook is invoked first.

Use it in place of &cobra.Command{}, e.g.

command := TraverseRunHooks(&cobra.Command{
	PersistentPreRun: func ...,
})

Types

type BosunIssueMetadata

type BosunIssueMetadata struct {
	BaseBranch string `yaml:"baseBranch"`
	Branch     string `yaml:"branch"`
	Story      string `yaml:"story"`
	Task       string `yaml:"task"`
}

func (BosunIssueMetadata) String

func (b BosunIssueMetadata) String() string

type FilterParams

type FilterParams struct {
	Names   []string
	All     bool
	Include []string
	Exclude []string
	Labels  []string
	// contains filtered or unexported fields
}

func (FilterParams) ApplyToDeploySettings

func (f FilterParams) ApplyToDeploySettings(d *bosun.DeploySettings)

ApplyToDeploySettings will set a filter on the deploy settings if the filter is not empty.

func (FilterParams) Chain

func (f FilterParams) Chain() filter.Chain

func (FilterParams) GetApp

func (f FilterParams) GetApp() (*bosun.App, error)

func (FilterParams) GetAppDeploys

func (f FilterParams) GetAppDeploys() ([]*bosun.AppDeploy, error)

func (FilterParams) GetApps

func (f FilterParams) GetApps() bosun.AppList

func (FilterParams) GetAppsChain

func (f FilterParams) GetAppsChain(chain filter.Chain) ([]*bosun.App, error)

func (FilterParams) IncludeCurrent

func (f FilterParams) IncludeCurrent() FilterParams

func (FilterParams) IsEmpty

func (f FilterParams) IsEmpty() bool

func (FilterParams) MustGetApp

func (f FilterParams) MustGetApp() *bosun.App

func (FilterParams) MustGetAppDeploys

func (f FilterParams) MustGetAppDeploys() []*bosun.AppDeploy

func (FilterParams) PreferCurrent

func (f FilterParams) PreferCurrent() FilterParams

type GitPullRequestCommand

type GitPullRequestCommand struct {
	Reviewers     []string
	Title         string
	Body          string
	Base          string
	FromBranch    string
	LocalRepoPath string
}

func (GitPullRequestCommand) Execute

func (c GitPullRequestCommand) Execute() (issueNmb, prNumber int, err error)

type MoveMap

type MoveMap struct {
	Moves map[string]string `yaml:"moves"`
}

type QAApp

type QAApp struct {
	Branch stories.BranchRef
	App    *bosun.App
}

type QAStory

type QAStory struct {
	Bosun    *bosun.Bosun
	Platform *bosun.Platform
	Cluster  *kube.Cluster
	Stack    *kube.Stack
	Story    *stories.Story
	Handler  stories.StoryHandler
	Apps     map[string]*QAApp
}

Jump to

Keyboard shortcuts

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