@amalia-oss/nx-remotecache-gcs
v2.0.0
Published
A task runner for nx with google cloud storage buckets as remote cache
Downloads
1,023
Readme
nx-remotecache-gcs
A task runner for nx that uses Google Cloud Storage as our remote cache bucket.
Using a remote cache enables all team members and CI servers to share a single cache.
The concept and benefits of computation caching are explained in the NX documentation.
This package was built with nx-remotecache-custom.
Install
npm install --save-dev @amalia-oss/nx-remotecache-gcs
Setup
This task runner relies upon @google-cloud/storage
.
This package considers that you've already configured your Google Cloud CLI, especially the application default credentials if you work locally.
gcloud auth application-default login
The procedure for an automated environment such as a CI/CD can differ.
Configuration
| Parameter | Description | Environment Variable | nx.json
|
| ----------- | ----------------------------------------------------- | ------------------------ | ------------ |
| Bucket Name | The name of your GCS bucket to use as cache container | NX_REMOTE_CACHE_BUCKET
| bucketName
|
By default, environment variables will be loaded from the .env
file at the root of your workspace.
See #Advanced Configuration for more information.
NB: The environment variable will always take precedence over the nx.json
configuration.
In your nx.json
file:
{
"tasksRunnerOptions": {
"default": {
"runner": "@amalia-oss/nx-remotecache-gcs",
"options": {
"bucketName": "my-bucket-name",
"cacheableOperations": ["build", "test", "lint", "e2e"]
}
}
}
}
Advanced Configuration
{
"tasksRunnerOptions": {
"default": {
"runner": "@amalia-oss/nx-remotecache-gcs",
"options": {
"bucketName": "my-bucket-name",
"cacheableOperations": ["build", "test", "lint", "e2e"],
"silent": false,
"verbose": false,
"dotenv": true,
"dotenvPath": ".env"
}
}
}
}