Update environments

This commit is contained in:
Ross McDonald
2018-02-02 15:20:45 -06:00
parent 213dbf5a28
commit 4fdb7ea483

View File

@@ -1,25 +1,50 @@
# Environments
![](../../assets/gifs/editor-configuration.gif)
<!--(FIXME - SHOW CLICKING BETWEEN DIFFERENT ENVIRONMENTS)-->
The Stoplight editor includes an embedded configuration system that can be used to auto-populate environment information and other variables (hostnames, ports, passwords, etc.) utilized by specifications, scenarios, or collections. To setup the editor configuration, click the icon towards the top right of the editor screen immediately to the left of your username.
The Stoplight editor includes an embedded configuration system that can be used
to auto-populate environment information and other variables (hostnames, ports,
passwords, etc.) utilized by specifications, scenarios, or collections. To
display the current editor environment variables, click the icon on the top
right of the Stoplight editor as shown in the image above.
![](../../assets/images/editor-configuration.png)
<!--(FIXME - SHOW SCREENSHOT OF THE ENVIRONMENTS WINDOW)-->
For more information on environment variables and how they can be used, please
see [here](../testing/variables-environment.md).
## Private Variables
The left-half of the configuration window is dedicated to "Private Variables", which are variables that are _only_ stored locally on your system and are never sent to Stoplight. Private Variables should be reserved for secrets specific to you, such as user-specific passwords, API keys, and other pieces of sensitive data.
Private Variables are variables that are _only_ stored locally on your system
and are never sent to Stoplight or the rest of your team. Private variables
should be reserved for secrets specific to you, such as user-specific passwords,
API keys, and other pieces of sensitive data.
## Resolved Variables
> Since private variables are only stored on your computer, make sure they are
backed up in a secure location
The right-half of the configuration window displays "Resolved Variables", which is a read-only view of the variables currently exposed to your editor based on your current environment. These variables are stored in the `.stoplight` file included in your project (under "Config" in the File Explorer). To update the default or environment-specific variables stored in Stoplight, click the "Manage Environments" button under the configuration window.
## Resolved Variables
![](../../assets/gifs/editor-configuration2.gif)
Resolved Variables shows a read-only view of the variables that are currently
exposed to your editor, based on:
Variables stored in your configuration are in JSON, and can be referenced using the following format:
* Your current environment
* Your private variables
```
{$$.env.myVariable}
```
These variables (excluding your private variables) are stored in the
`.stoplight` file of your project (under "Config" in the File Explorer).
Where `myVariable` is the name of the variable in your configuration.
To update the default or environment-specific variables stored in Stoplight,
click the "Manage Environments" button under the configuration window.
<!--(FIXME - SHOW GIF OF CLICKING MANAGE ENVIRONMENTS BUTTON)-->
For more information on updating and customizing environment variables, please
see [here](./editor-configuration.md#environments).
***
**Results**
* [Using Environment Variables](../testing/variables-environment.md)
* [Configuration with the `.stoplight.yml` File](./editor-configuration.md#environments)