open-nomad/command/deployment.go

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

52 lines
1.3 KiB
Go
Raw Normal View History

2017-06-30 17:59:19 +00:00
package command
2018-03-21 21:04:54 +00:00
import (
"strings"
"github.com/mitchellh/cli"
)
2017-06-30 17:59:19 +00:00
type DeploymentCommand struct {
Meta
}
func (f *DeploymentCommand) Help() string {
2018-03-21 21:04:54 +00:00
helpText := `
Usage: nomad deployment <subcommand> [options] [args]
This command groups subcommands for interacting with deployments. Deployments
2018-03-22 22:18:09 +00:00
are used to manage a transition between two versions of a Nomad job. Users
2018-03-21 21:04:54 +00:00
can inspect an ongoing deployment, promote canary allocations, force fail
deployments, and more.
Examine a deployments status:
$ nomad deployment status <deployment-id>
Promote the canaries to allow the remaining allocations to be updated in a
rolling deployment fashion:
2018-05-24 16:44:21 +00:00
$ nomad deployment promote <deployment-id>
2018-03-21 21:04:54 +00:00
Mark a deployment as failed. This will stop new allocations from being placed
and if the job's upgrade block specifies auto_revert, causes the job to
2018-03-21 21:04:54 +00:00
revert back to the last stable version of the job:
2018-05-24 16:44:21 +00:00
$ nomad deployment fail <deployment-id>
2018-03-21 21:04:54 +00:00
Please see the individual subcommand help for detailed usage information.
`
return strings.TrimSpace(helpText)
2017-06-30 17:59:19 +00:00
}
func (f *DeploymentCommand) Synopsis() string {
return "Interact with deployments"
}
func (f *DeploymentCommand) Name() string { return "deployment" }
2017-06-30 17:59:19 +00:00
func (f *DeploymentCommand) Run(args []string) int {
return cli.RunResultHelp
}