Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(core): always use environment variable for cache directory #6746

Conversation

shihabuddin
Copy link
Contributor

In 6c16ee0 the environment variable was used
while reading from nx.json. But in packages/workspace/src/tasks-runner/cache.ts
the cacheDirectory is used without using readCacheDirectoryProperty. Now we
check the environment variable in cacheDirectory, so that the environment
variable is always used.

ISSUES CLOSED: #6629

Current Behavior

The cache directory can only be set using nx.json.

Expected Behavior

The cache directory set in nx.json can be overwritten using environment variable NX_CACHE_DIRECTORY.

Related Issue(s)

Fixes #6629

In 6c16ee0 the environment variable was used
while reading from `nx.json`. But in `packages/workspace/src/tasks-runner/cache.ts`
the `cacheDirectory` is used without using `readCacheDirectoryProperty`. Now we
check the environment variable in `cacheDirectory`, so that the environment
variable is always used.

ISSUES CLOSED: nrwl#6629
@vercel
Copy link

vercel bot commented Aug 17, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/nrwl/nx-dev/BEBHt4hHGTNDjrzh51gqBsq6qwNb
✅ Preview: Canceled

@nx-cloud
Copy link

nx-cloud bot commented Aug 17, 2021

Nx Cloud Report

We didn't find any information for the current pull request with the commit ec9cd44.
You might need to set the 'NX_BRANCH' environment variable in your CI pipeline.

Check the Nx Cloud Github Integration documentation for more information.


Sent with 💌 from NxCloud.

@shihabuddin
Copy link
Contributor Author

@FrozenPandaz Any idea why the build failed? I couldn't find any error message.

Copy link
Collaborator

@FrozenPandaz FrozenPandaz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for fixing this! LGTM 🎉

@FrozenPandaz FrozenPandaz merged commit eaa0287 into nrwl:master Aug 18, 2021
ManojBahuguna pushed a commit to ManojBahuguna/nx that referenced this pull request Sep 16, 2021
…6746)

In 6c16ee0 the environment variable was used
while reading from `nx.json`. But in `packages/workspace/src/tasks-runner/cache.ts`
the `cacheDirectory` is used without using `readCacheDirectoryProperty`. Now we
check the environment variable in `cacheDirectory`, so that the environment
variable is always used.

ISSUES CLOSED: nrwl#6629
@github-actions
Copy link

This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 20, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

environment variable to override cacheDirectory in nx.json
2 participants