Documentation ¶
Index ¶
- Variables
- func CmdList(svcName string, ir IReleases, is services.IServices) error
- func CmdRm(svcName, releaseName string, ir IReleases, is services.IServices) error
- func CmdUpdate(svcName, releaseName, notes, newReleaseName string, ir IReleases, ...) error
- type IReleases
- type SReleases
- type SortedReleases
Constants ¶
This section is empty.
Variables ¶
View Source
var Cmd = models.Command{ Name: "releases", ShortHelp: "Manage releases for code services", LongHelp: "The `releases` command allows you to manage your code service releases. " + "A release is automatically created each time you perform a git push. " + "The release is tagged with the git SHA of the commit. " + "Releases are a way of tagging specific points in time of your git history. " + "You can rollback to a specific release by using the [rollback](#rollback) command. " + "The releases command cannot be run directly but has sub commands.", CmdFunc: func(settings *models.Settings) func(cmd *cli.Cmd) { return func(cmd *cli.Cmd) { cmd.CommandLong(ListSubCmd.Name, ListSubCmd.ShortHelp, ListSubCmd.LongHelp, ListSubCmd.CmdFunc(settings)) cmd.CommandLong(RmSubCmd.Name, RmSubCmd.ShortHelp, RmSubCmd.LongHelp, RmSubCmd.CmdFunc(settings)) cmd.CommandLong(UpdateSubCmd.Name, UpdateSubCmd.ShortHelp, UpdateSubCmd.LongHelp, UpdateSubCmd.CmdFunc(settings)) } }, }
Cmd for keys
View Source
var ListSubCmd = models.Command{ Name: "list", ShortHelp: "List all releases for a given code service", LongHelp: "`releases list` lists all of the releases for a given service. " + "A release is automatically created each time a git push is performed. " + "Here is a sample command\n\n" + "```\ncatalyze -E \"<your_env_alias>\" releases list code-1\n```", CmdFunc: func(settings *models.Settings) func(cmd *cli.Cmd) { return func(cmd *cli.Cmd) { serviceName := cmd.StringArg("SERVICE_NAME", "", "The name of the service to list releases for") cmd.Action = func() { if _, err := auth.New(settings, prompts.New()).Signin(); err != nil { logrus.Fatal(err.Error()) } if err := config.CheckRequiredAssociation(true, true, settings); err != nil { logrus.Fatal(err.Error()) } err := CmdList(*serviceName, New(settings), services.New(settings)) if err != nil { logrus.Fatal(err) } } } }, }
View Source
var RmSubCmd = models.Command{ Name: "rm", ShortHelp: "Remove a release from a code service", LongHelp: "`releases rm` removes an existing release. This is useful in the case of a misbehaving code service. " + "Removing the release avoids the risk of rolling back to a \"bad\" build. Here is a sample command\n\n" + "```\ncatalyze -E \"<your_env_alias>\" releases rm code-1 f93ced037f828dcaabccfc825e6d8d32cc5a1883\n```", CmdFunc: func(settings *models.Settings) func(cmd *cli.Cmd) { return func(cmd *cli.Cmd) { serviceName := cmd.StringArg("SERVICE_NAME", "", "The name of the service to remove a release from") releaseName := cmd.StringArg("RELEASE_NAME", "", "The name of the release to remove") cmd.Action = func() { if _, err := auth.New(settings, prompts.New()).Signin(); err != nil { logrus.Fatal(err.Error()) } if err := config.CheckRequiredAssociation(true, true, settings); err != nil { logrus.Fatal(err.Error()) } err := CmdRm(*serviceName, *releaseName, New(settings), services.New(settings)) if err != nil { logrus.Fatal(err) } } } }, }
View Source
var UpdateSubCmd = models.Command{ Name: "update", ShortHelp: "Update a release from a code service", LongHelp: "`releases update` allows you to rename or add notes to an existing release. " + "By default, releases are named with the git SHA of the commit used to create the release. " + "Renaming them allows you to organize your releases. Here is a sample command\n\n" + "```\ncatalyze -E \"<your_env_alias>\" releases update code-1 f93ced037f828dcaabccfc825e6d8d32cc5a1883 --notes \"This is a stable build\" --release v1\n```", CmdFunc: func(settings *models.Settings) func(cmd *cli.Cmd) { return func(cmd *cli.Cmd) { serviceName := cmd.StringArg("SERVICE_NAME", "", "The name of the service to update a release for") releaseName := cmd.StringArg("RELEASE_NAME", "", "The name of the release to update") notes := cmd.StringOpt("n notes", "", "The new notes to save on the release. If omitted, notes will be unchanged.") newReleaseName := cmd.StringOpt("r release", "", "The new name of the release. If omitted, the release name will be unchanged.") cmd.Action = func() { if _, err := auth.New(settings, prompts.New()).Signin(); err != nil { logrus.Fatal(err.Error()) } if err := config.CheckRequiredAssociation(true, true, settings); err != nil { logrus.Fatal(err.Error()) } err := CmdUpdate(*serviceName, *releaseName, *notes, *newReleaseName, New(settings), services.New(settings)) if err != nil { logrus.Fatal(err) } } cmd.Spec = "SERVICE_NAME RELEASE_NAME [--notes] [--release]" } }, }
Functions ¶
Types ¶
type IReleases ¶
type SortedReleases ¶
SortedReleases is a wrapper for Release array in order to sort them by CreatedAt
func (SortedReleases) Len ¶
func (rls SortedReleases) Len() int
func (SortedReleases) Less ¶
func (rls SortedReleases) Less(i, j int) bool
func (SortedReleases) Swap ¶
func (rls SortedReleases) Swap(i, j int)
Click to show internal directories.
Click to hide internal directories.