Skip to content

Commit aa8878e

Browse files
Merge pull request circleci#3663 from devxpy/patch-3
Update env-vars.md
2 parents ffee99b + 2325752 commit aa8878e

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

jekyll/_cci2/env-vars.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,24 @@ In every step, CircleCI uses `bash` to source `BASH_ENV`. This means that `BASH_
116116
allowing you to use interpolation and share environment variables across `run` steps.
117117

118118
**Note:**
119-
The `BASH_ENV` workaround only works with `bash`. Other implementations like `sh` will not work. This limitation affects your image options. For example, because [Alpine images](https://alpinelinux.org/) do not include `bash` by default, the `BASH_ENV` workaround will not work without first installing `bash`.
119+
The `$BASH_ENV` workaround only works with `bash`.
120+
Other shells probably won't work.
121+
122+
### Alpine Linux
123+
124+
An image that's based on [Alpine Linux](https://alpinelinux.org/) (like [docker](https://hub.docker.com/_/docker)), uses the `ash` shell.
125+
126+
To use environment variables with `ash`, just add these 2 parameters to your job.
127+
128+
```yaml
129+
jobs:
130+
build:
131+
132+
shell: /bin/sh -leo pipefail
133+
environment:
134+
- BASH_ENV: /etc/profile
135+
```
136+
120137

121138
## Setting an Environment Variable in a Shell Command
122139

0 commit comments

Comments
 (0)