Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Cmd = models.Command{ Name: "associate", ShortHelp: "Associates an environment", LongHelp: "`associate` is the entry point of the cli. You need to associate an environment before you can run most other commands. " + "Check out [scope](#global-scope) and [aliases](#environment-aliases) for more info on the value of the alias and default options. Here is a sample command\n\n" + "```\ncatalyze associate My-Production-Environment app01 -a prod\n```", CmdFunc: func(settings *models.Settings) func(cmd *cli.Cmd) { return func(cmd *cli.Cmd) { envName := cmd.StringArg("ENV_NAME", "", "The name of your environment") serviceName := cmd.StringArg("SERVICE_NAME", "", "The name of the primary code service to associate with this environment (i.e. 'app01')") alias := cmd.StringOpt("a alias", "", "A shorter name to reference your environment by for local commands") remote := cmd.StringOpt("r remote", "catalyze", "The name of the remote") defaultEnv := cmd.BoolOpt("d default", false, "[DEPRECATED] Specifies whether or not the associated environment will be the default") cmd.Action = func() { if _, err := auth.New(settings, prompts.New()).Signin(); err != nil { logrus.Fatal(err.Error()) } err := CmdAssociate(*envName, *serviceName, *alias, *remote, *defaultEnv, New(settings), git.New(), environments.New(settings), services.New(settings)) if err != nil { logrus.Fatal(err.Error()) } } cmd.Spec = "ENV_NAME SERVICE_NAME [-a] [-r] [-d]" } }, }
Cmd is the contract between the user and the CLI. This specifies the command name, arguments, and required/optional arguments and flags for the command.
Functions ¶
func CmdAssociate ¶
func CmdAssociate(envLabel, svcLabel, alias, remote string, defaultEnv bool, ia IAssociate, ig git.IGit, ie environments.IEnvironments, is services.IServices) error
Types ¶
type IAssociate ¶
type IAssociate interface {
Associate(name, remote string, defaultEnv bool, env *models.Environment, chosenService *models.Service) error
}
interfaces are the API calls
func New ¶
func New(settings *models.Settings) IAssociate
type SAssociate ¶
SAssociate is a concrete implementation of IAssociate
func (*SAssociate) Associate ¶
func (s *SAssociate) Associate(name, remote string, defaultEnv bool, env *models.Environment, chosenService *models.Service) error
Associate an environment so that commands can be run against it. This command no longer adds a git remote. See commands.AddRemote().
Click to show internal directories.
Click to hide internal directories.