Prefer "up" over "update" (#1672)

This commit is contained in:
Joe Duffy 2018-07-31 10:22:16 -07:00 committed by GitHub
parent d19942f2b0
commit 76eea4863a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 17 additions and 17 deletions

View file

@ -129,7 +129,7 @@ func NewPulumiCmd() *cobra.Command {
cmd.AddCommand(newPreviewCmd())
cmd.AddCommand(newRefreshCmd())
cmd.AddCommand(newStackCmd())
cmd.AddCommand(newUpdateCmd())
cmd.AddCommand(newUpCmd())
cmd.AddCommand(newVersionCmd())
cmd.AddCommand(newWhoAmICmd())

View file

@ -25,7 +25,7 @@ import (
"github.com/pulumi/pulumi/pkg/util/cmdutil"
)
func newUpdateCmd() *cobra.Command {
func newUpCmd() *cobra.Command {
var debug bool
var expectNop bool
var message string
@ -43,20 +43,20 @@ func newUpdateCmd() *cobra.Command {
var yes bool
var cmd = &cobra.Command{
Use: "update",
Aliases: []string{"up"},
Use: "up",
Aliases: []string{"update"},
SuggestFor: []string{"deploy", "push"},
Short: "Update the resources in a stack",
Long: "Update the resources in a stack.\n" +
Short: "Create or update the resources in a stack",
Long: "Create or update the resources in a stack.\n" +
"\n" +
"This command updates an existing stack whose state is represented by the existing checkpoint\n" +
"file. The new desired state is computed by running a Pulumi program, and extracting all resource\n" +
"allocations from its resulting object graph. These allocations are then compared against the\n" +
"existing state to determine what operations must take place to achieve the desired state. This\n" +
"command results in a checkpoint containing a full snapshot of the stack's new resource state, so\n" +
"that it may be updated incrementally again later.\n" +
"This command creates or updates resources in a stack. The new desired goal state for the target stack\n" +
"is computed by running the current Pulumi program and observing all resource allocations to produce a\n" +
"resource graph. This goal state is then compared against the existing state to determine what create,\n" +
"read, update, and/or delete operations must take place to achieve the desired goal state, in the most\n" +
"minimally disruptive way. This command records a full transactional snapshot of the stack's new state\n" +
"afterwards so that the stack may be updated incrementally again later on.\n" +
"\n" +
"The program to run is loaded from the project in the current directory. Use the `-C` or\n" +
"The program to run is loaded from the project in the current directory by default. Use the `-C` or\n" +
"`--cwd` flag to use a different directory.",
Args: cmdutil.NoArgs,
Run: cmdutil.RunFunc(func(cmd *cobra.Command, args []string) error {

View file

@ -674,7 +674,7 @@ func (pt *programTester) previewAndUpdate(dir string, name string, shouldFail, e
expectNopUpdate bool) error {
preview := []string{"preview", "--non-interactive"}
update := []string{"update", "--non-interactive", "--skip-preview"}
update := []string{"up", "--non-interactive", "--skip-preview"}
if pt.opts.GetDebugUpdates() {
preview = append(preview, "-d")
update = append(update, "-d")

View file

@ -67,7 +67,7 @@ func TestProjectMain(t *testing.T) {
e.ImportDirectory("project_main_abs")
e.RunCommand("pulumi", "login", "--cloud-url", e.LocalURL())
e.RunCommand("pulumi", "stack", "init", "main-abs")
stdout, stderr := e.RunCommandExpectError("pulumi", "update", "--non-interactive", "--skip-preview", "--yes")
stdout, stderr := e.RunCommandExpectError("pulumi", "up", "--non-interactive", "--skip-preview", "--yes")
assert.Equal(t, "", stdout)
assert.Contains(t, stderr, "project 'main' must be a relative path")
e.RunCommand("pulumi", "stack", "rm", "--yes")
@ -83,7 +83,7 @@ func TestProjectMain(t *testing.T) {
e.ImportDirectory("project_main_parent")
e.RunCommand("pulumi", "login", "--cloud-url", e.LocalURL())
e.RunCommand("pulumi", "stack", "init", "main-parent")
stdout, stderr := e.RunCommandExpectError("pulumi", "update", "--non-interactive", "--skip-preview", "--yes")
stdout, stderr := e.RunCommandExpectError("pulumi", "up", "--non-interactive", "--skip-preview", "--yes")
assert.Equal(t, "", stdout)
assert.Contains(t, stderr, "project 'main' must be a subfolder")
e.RunCommand("pulumi", "stack", "rm", "--yes")

View file

@ -233,7 +233,7 @@ func TestStackBackups(t *testing.T) {
// Now run pulumi update.
before := time.Now().UnixNano()
e.RunCommand("pulumi", "update", "--non-interactive", "--skip-preview", "--yes")
e.RunCommand("pulumi", "up", "--non-interactive", "--skip-preview", "--yes")
after := time.Now().UnixNano()
// Verify the backup directory contains a single backup.