pulumi/sdk/go/common/util/cmdutil
Pat Gavlin d1ff268b10 [esc] Add commands for managing stack environments
These changes add three commands for managing a stack's environments:

- `pulumi config env init`, which creates a new environment for a stack
  based on its configuration values
- `pulumi config env add`, which adds environments to a stack's import
  list
- `pulumi config env rm`, which removes an environment from a stack's
  import list

As implied by their paths, these commands hang off of a new sub-command
of `pulumi config`, `pulumi config env`.

From the usage:

* `pulumi config env init`

Creates an environment for a specific stack based on the stack's
configuration values, then replaces the stack's configuration values with
a reference to that environment. The environment will be created in the
same organization as the stack.

* `pulumi config env add`

Adds environments to the end of a stack's import list. Imported
environments are merged in order per the ESC merge rules. The list of
stacks behaves as if it were the import list in an anonymous environment.

* `pulumi config env rm`

Removes an environment from a stack's import list.

Each of these commands previews the new stack environment and shows the
environment definition. These commands print a warning if the stack's
environment does not define any of the `environmentVariables`, `files`,
or `pulumiConfig` properties.

These changes also add an `ENVIRONMENT` block to the output of `pulumi
config` for stacks that reference environments. This block shows the
definition of the stack's environment. In order to improve the
appearence of these tables, these changes also add a helper function
that colorizes the header row.

Finally, these changes add a warning on `pulumi env add`, `pulumi env
rm`, and `pulumi up/refresh/etc.` for stacks that reference environments
that do define any of `environmentVariables`, `files`, or
`pulumiConfig`, and add a tag to update metadata that includes the
environments associated with an update.
2023-11-13 16:38:31 -08:00
..
testdata feat(cmdutil): TerminateProcessGroup for graceful termination (#13792) 2023-08-27 22:05:44 +00:00
args.go [breaking] Changing the version of go.mod in sdk / pkg to be v3 2021-04-14 19:32:18 +01:00
child_unix.go Revert "resource/plugin: Shut down plugins gracefully (#13795)" (#13844) 2023-08-31 16:29:55 +00:00
child_windows.go Revert "resource/plugin: Shut down plugins gracefully (#13795)" (#13844) 2023-08-31 16:29:55 +00:00
console.go [esc] Add commands for managing stack environments 2023-11-13 16:38:31 -08:00
console_password.go cmdutil.ReadConsole[NoEcho]: Use bubbletea (#13815) 2023-08-30 17:08:44 +00:00
console_test.go cmdutil.ReadConsole[NoEcho]: Use bubbletea (#13815) 2023-08-30 17:08:44 +00:00
diag.go all: Reformat with gofumpt 2023-03-03 09:00:24 -08:00
exit.go cmdutil: Support errors.Join-based multi-errors (#13813) 2023-09-01 19:01:16 +00:00
exit_test.go cmdutil: Support errors.Join-based multi-errors (#13813) 2023-09-01 19:01:16 +00:00
profile.go [cli] Better memory profiling 2023-05-25 09:20:12 -07:00
spinner.go all: Reformat with gofumpt 2023-03-03 09:00:24 -08:00
term.go feat(cmdutil): TerminateProcessGroup for graceful termination (#13792) 2023-08-27 22:05:44 +00:00
term_test.go feat(cmdutil): TerminateProcessGroup for graceful termination (#13792) 2023-08-27 22:05:44 +00:00
term_unix.go feat(cmdutil): TerminateProcessGroup for graceful termination (#13792) 2023-08-27 22:05:44 +00:00
term_windows.go feat(cmdutil): TerminateProcessGroup for graceful termination (#13792) 2023-08-27 22:05:44 +00:00
trace.go all: Reformat with gofumpt 2023-03-03 09:00:24 -08:00