rollback

package
v2.0.0-snapshot...-58e3a78 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2017 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Cmd = models.Command{
	Name:      "rollback",
	ShortHelp: "Rollback a code service to a specific release",
	LongHelp: "`rollback` is a way to redeploy older versions of your code service. " +
		"You must specify the name of the service to rollback and the name of an existing release to rollback to. " +
		"Releases can be found with the [releases list](#releases-list) command. Here are some sample commands\n\n" +
		"```\ncatalyze -E \"<your_env_alias>\" rollback 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 rollback")
			releaseName := cmd.StringArg("RELEASE_NAME", "", "The name of the release to rollback to")
			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 := CmdRollback(*serviceName, *releaseName, jobs.New(settings), releases.New(settings), services.New(settings))
				if err != nil {
					logrus.Fatal(err.Error())
				}
			}
			cmd.Spec = "SERVICE_NAME RELEASE_NAME"
		}
	},
}

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 CmdRollback

func CmdRollback(svcName, releaseName string, ij jobs.IJobs, irs releases.IReleases, is services.IServices) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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