github.com/hernad/nomad@v1.6.112/command/deployment.go (about)

     1  // Copyright (c) HashiCorp, Inc.
     2  // SPDX-License-Identifier: MPL-2.0
     3  
     4  package command
     5  
     6  import (
     7  	"strings"
     8  
     9  	"github.com/mitchellh/cli"
    10  )
    11  
    12  type DeploymentCommand struct {
    13  	Meta
    14  }
    15  
    16  func (f *DeploymentCommand) Help() string {
    17  	helpText := `
    18  Usage: nomad deployment <subcommand> [options] [args]
    19  
    20    This command groups subcommands for interacting with deployments. Deployments
    21    are used to manage a transition between two versions of a Nomad job. Users
    22    can inspect an ongoing deployment, promote canary allocations, force fail
    23    deployments, and more.
    24  
    25    Examine a deployments status:
    26  
    27        $ nomad deployment status <deployment-id>
    28  
    29    Promote the canaries to allow the remaining allocations to be updated in a
    30    rolling deployment fashion:
    31  
    32        $ nomad deployment promote <deployment-id>
    33  
    34    Mark a deployment as failed. This will stop new allocations from being placed
    35    and if the job's upgrade block specifies auto_revert, causes the job to
    36    revert back to the last stable version of the job:
    37  
    38        $ nomad deployment fail <deployment-id>
    39  
    40    Please see the individual subcommand help for detailed usage information.
    41  `
    42  
    43  	return strings.TrimSpace(helpText)
    44  }
    45  
    46  func (f *DeploymentCommand) Synopsis() string {
    47  	return "Interact with deployments"
    48  }
    49  
    50  func (f *DeploymentCommand) Name() string { return "deployment" }
    51  
    52  func (f *DeploymentCommand) Run(args []string) int {
    53  	return cli.RunResultHelp
    54  }