Skip to content

Commit 2e6f199

Browse files
Merge pull request circleci#1107 from circleci/local-builds-env-vars-limitation
Update local-jobs.md
2 parents 90fc145 + dbce637 commit 2e6f199

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

jekyll/_cci2/local-jobs.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,10 @@ The CLI tool automatically checks for updates and will prompt you if one is avai
7777

7878
Although running jobs locally with `circleci` is very helpful, there are some limitations.
7979

80+
### Setting Environment Variables
81+
82+
We don't yet have an ideal solution for setting environment variables for local builds, but there is a workaround. Define which variables you want to export in a file within your repository (don't commit it - just have it in the directory). Then set BASH_ENV to that filename in your `.cirecleci/config.yml` file. The file will be automatically sourced on each command as long as BASH_ENV is correct.
83+
8084
### Machine Executor
8185

8286
You cannot use the machine executor in local jobs. This is because the machine executor requires an extra VM to run its jobs.
@@ -87,12 +91,10 @@ Caching is not currently supported in local jobs. When you have either a `save_c
8791

8892
### Relative Path for working_directory
8993

90-
Using a relative path for `working_directory` is not currently supported in local jobs. If a relative path is used in `working_directory`, then `circleci` returns an error and immediately exists.
94+
The `working_directory:` key in your `.cirecleci/config.yml` file must not use a relative path for local jobs. If a relative path is used in `working_directory`, then `circleci` returns an error and immediately exits. To workaround this problem, change the value of the `working_directory:` key in your `.cirecleci/config.yml` file to use an absolute path.
9195

9296
This happens because `circleci` mounts the current directory to `working_directory` in order to skip the checkout step, but Docker doesn't allow the container path to be relative for a volume. See [here](https://github.com/docker/docker/issues/4830) for more details.
9397

94-
The workaround is updating `working_directory` to use an absolute path.
95-
9698
We plan to remove this limitation in a future update.
9799

98100
## Using the CircleCI CLI non-locally

0 commit comments

Comments
 (0)