pulumi/sdk/go/common/workspace
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
..
config.go [esc] Add commands for managing stack environments 2023-11-13 16:38:31 -08:00
creds.go Fix panic in whoami (#14108) 2023-10-06 16:56:36 +00:00
creds_test.go ci: radical idea - what if slow tests & no stdout makes GH consider runner dead? 2022-03-06 14:52:13 -08:00
loaders.go Remove the global caches for project files 2023-03-07 12:44:24 +00:00
loaders_test.go ignore unexpected types instead of erroring out (#14149) 2023-10-11 16:39:16 +00:00
paths.go Translate permission errors into ProjectNotFound when searching 2023-06-20 15:15:40 +01:00
paths_test.go Translate permission errors into ProjectNotFound when searching 2023-06-20 15:15:40 +01:00
plugins.go Support {NAME} in plugin download url (#14435) 2023-10-30 09:29:12 +00:00
plugins_install_nodejs_test.go ci: Use reduced smoke testing on Windows & macOS targets 2022-09-21 09:55:06 -07:00
plugins_install_python_test.go ci: Use reduced smoke testing on Windows & macOS targets 2022-09-21 09:55:06 -07:00
plugins_install_test.go all: Reformat with gofumpt 2023-03-03 09:00:24 -08:00
plugins_test.go Support {NAME} in plugin download url (#14435) 2023-10-30 09:29:12 +00:00
project.go [esc] Add commands for managing stack environments 2023-11-13 16:38:31 -08:00
project.json fix #11864: pulumi panics when Pulumi.yaml has a provider with an empty/unspecified `path` key 2023-01-18 10:33:39 -08:00
project_test.go [esc] Add commands for managing stack environments 2023-11-13 16:38:31 -08:00
settings.go move pkg/workspace -> sdk/go/common/workspace 2020-03-18 14:35:53 -07:00
templates.go Adds remote .zip archive support to `pulumi new` (#14443) 2023-10-31 22:05:39 +00:00
templates_test.go Use `assert.NoError` rather than `assert.Nil` (#14233) 2023-10-13 09:46:07 +00:00
templates_zip.go Simplifies URL parsing for pulumi new <zip> (#14546) 2023-11-13 17:08:52 +00:00
templates_zip_test.go Fix panic in isZIPTemplateURL (#14504) 2023-11-06 15:26:47 +00:00
workspace.go all: Reformat with gofumpt 2023-03-03 09:00:24 -08:00