pulumi/pkg
Justin Van Patten 2dd13292a3
Consolidate some `new` and `up` functionality (#1884)
Previously `new` was operating under the assumption that it was always
going to be creating a new project/stack, and would always prompt for
these values. However, we want to be able to use `new` to pull down the
source for an existing stack. This change adds a `--stack` flag to `new`
that can be used to specify an existing stack. If the specified stack
already exists, we won't prompt for the project name/description, and
instead just use the existing stack's values. If `--stack` is specified,
but doesn't already exist, it will just use that as the stack name
(instead of prompting) when creating the stack. `new` also now handles
configuration like `up <url>`: if the stack is a preconfigured empty
stack (i.e. it was created/configured in the Pulumi Console via Pulumi
Button or New Project), we will use the existing stack's config without
prompting. Otherwise we will prompt for config, and just like `up
<url>`, we'll use the existing stack's config values as defaults when
prompting, or if the stack didn't exist, use the defaults from the
template.

Previously `up <url>`'s handling of the project name/description wasn't
correct: it would always automatically use the values from the template
without prompting. Now, just like `new`:

 - When updating an existing stack, it will not prompt, and just use the
   existing stack's values.

 - When creating a new stack, it will prompt for the project
   name/description, using the defaults from the template.

This PR consolidates some of the `new`/`up` implementation so it shares
code for this functionality. There's definitely opportunities for a lot
more code reuse, but that cleanup can happen down the line if/when we
have the cycles.
2018-09-06 12:45:56 -07:00
..
apitype Clarify refresh text 2018-08-29 17:09:14 -07:00
backend Consolidate some `new` and `up` functionality (#1884) 2018-09-06 12:45:56 -07:00
diag Revert "Plumb `LogRequest.IsStatus` through the logging subsystem" 2018-08-31 15:56:53 -07:00
encoding Add license headers 2018-05-22 15:02:47 -07:00
engine Fail refreshes with init errors. (#1882) 2018-09-05 14:00:28 -07:00
graph Add license headers 2018-05-22 15:02:47 -07:00
operations Save resources obtained from ".get" in the snapshot (#1654) 2018-08-03 14:06:00 -07:00
resource Clarify control flow in step generator (#1843) 2018-09-05 15:08:09 -07:00
testing Update test frameworks to new packages 2018-09-05 08:16:14 -07:00
tokens Remove dead code (#1833) 2018-08-28 14:43:41 -07:00
tools Add a `WriteString` method to `tools/GenWriter`. (#1839) 2018-08-29 14:43:20 -07:00
util Clarify control flow in step generator (#1843) 2018-09-05 15:08:09 -07:00
version Add license headers 2018-05-22 15:02:47 -07:00
workspace Move away from ${PROJECT} and ${DESCRIPTION} (#1873) 2018-09-05 08:00:57 -07:00