@minka/nx-remote-cache
v1.0.11
Published
This repository provides an NX runner that utilizes a Google Cloud Platform (GCP) bucket as distributed cache storage.
Downloads
75
Readme
Minka NX Remote Cache
This repository provides an NX runner that utilizes a Google Cloud Platform (GCP) bucket as distributed cache storage.
Repo & Contributing
Currently the repo is private. If you are a part of the minka organization, you can contribute at: https://github.com/minkainc/ledger-nx-remote-cache
Features
- Distributed caching using GCP bucket
- Easy integration with NX workspace
Installation
To install the package, run:
npm install @minka/nx-remote-cache --save-dev
Configuration
To use, you must do 3 things.
- To configure the NX runner to use the GCP bucket as the cache storage, update your
nx.json
file'srunner
as follows. This is not needed if you perform step 3.
{
"tasksRunnerOptions": {
"default": {
"runner": "@minka/nx-remote-cache"
},
"options": {
"bucket": "your-bucket-name",
"project_id": "your-gcp-project-id"
}
}
}
- For the runner to be able to authenticate to GCP, you must auth to gcloud as shown below.
gcloud auth application-default login
- If you did not set
project_id
andbucket
in step 1, you can also set these by exporting these env vars to your environment:
export NXCACHE_GOOGLE_STORAGE_PROJECT_ID=<your-gcp-project-id>
export NXCACHE_GOOGLE_STORAGE_BUCKET=<your-bucket-name>
Options
project
: The GCP project ID.bucket
: The name of the GCP bucket to be used for caching.
Usage
Once configured, the NX runner will automatically use the specified GCP bucket for distributed caching. You can run your NX commands as usual.
Authentication
Ensure that you have performed step 2 from the Configuration
section.