Skip to content
This repository was archived by the owner on Dec 21, 2024. It is now read-only.

Commit ce3d283

Browse files
Merge pull request #636 from cucumber/environment-variables
Document how to define Environment variables
2 parents 3517314 + 58a64f2 commit ce3d283

File tree

5 files changed

+70
-2
lines changed

5 files changed

+70
-2
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ This involves getting the source code and building the documentation yourself.
1818

1919
# Get the source code
2020

21-
git clone https://github.com/cucumber/docs.cucumber.io.git
22-
cd docs.cucumber.io
21+
git clone https://github.com/cucumber/docs
22+
cd docs
2323

2424
### View the site
2525

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
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+
![Run/Debug Configuration](/img/environment-variables/idea/run-debug-configuration.png)
52+
53+
Click on the *Environment Variables* field.
54+
55+
![Environment Variabled Field](/img/environment-variables/idea/environment-variables-field.png)
56+
57+
Enter the environment variable and its value into the dialog.
58+
59+
![Run/Debug Configuration](/img/environment-variables/idea/enter-environment-variable.png)
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.
Loading
Loading
Loading

0 commit comments

Comments
 (0)