|
| 1 | +--- |
| 2 | +title: Environment Variables |
| 3 | +subtitle: How to define Environment Variables |
| 4 | +--- |
| 5 | + |
| 6 | +Cucumber uses [environment variables](https://en.wikipedia.org/wiki/Environment_variable) to enable |
| 7 | +certain features, such as publishing [Cucumber Reports](https://reports.cucumber.io). |
| 8 | + |
| 9 | +There are many different ways to define environment variables, depending on your environment. |
| 10 | +This guide describes how to set the `CUCUMBER_PUBLISH_ENABLED` environment variable to `true`. |
| 11 | + |
| 12 | +For security reasons you should *not* define `CUCUMBER_*` environment variables globally. |
| 13 | + |
| 14 | +For MacOS and Linux users this means you should *not* put them in `~/.bashrc`, |
| 15 | +`~/.bash_profile`, `~/.zshrc`, `/etc.profile` or similar. |
| 16 | + |
| 17 | +For Windows users this means you should *not* add them via System/Control Panel or `setx.exe`. |
| 18 | + |
| 19 | +## Terminal |
| 20 | + |
| 21 | +If you are using a terminal to run Cucumber, you should define environment variables in the |
| 22 | +same terminal. |
| 23 | + |
| 24 | +### Windows PowerShell |
| 25 | + |
| 26 | +```shell |
| 27 | +$Env:CUCUMBER_PUBLISH_ENABLED = 'true' |
| 28 | +``` |
| 29 | + |
| 30 | +### Windows Command Prompt |
| 31 | + |
| 32 | +```shell |
| 33 | +set CUCUMBER_PUBLISH_ENABLED=true |
| 34 | +``` |
| 35 | + |
| 36 | +### Bash / Zsh |
| 37 | + |
| 38 | +```shell |
| 39 | +export CUCUMBER_PUBLISH_ENABLED=true |
| 40 | +``` |
| 41 | + |
| 42 | +## Editor / IDE |
| 43 | + |
| 44 | +If you are using an editor or IDE to run Cucumber via a menu or shortcut, you should |
| 45 | +define environment variables in the editor. |
| 46 | + |
| 47 | +### IntelliJ IDEA / WebStorm / RubyMine |
| 48 | + |
| 49 | +Click the *Run/Debug Configuration* dropdown in the toolbar: |
| 50 | + |
| 51 | + |
| 52 | + |
| 53 | +Click on the *Environment Variables* field. |
| 54 | + |
| 55 | + |
| 56 | + |
| 57 | +Enter the environment variable and its value into the dialog. |
| 58 | + |
| 59 | + |
| 60 | + |
| 61 | +### Other editors |
| 62 | + |
| 63 | +Check the documentation for your editor, or help us improving this documentation by editing this page (link at the bottom of the page). |
| 64 | + |
| 65 | +## Continuous Integration Servers |
| 66 | + |
| 67 | +Every Continuous Integration server has a different mechanism for defining environment variables. |
| 68 | +Please consult the documentation for your CI server about how to do this. |
0 commit comments