A task runner for nx with google cloud storage buckets as remote cache
npm install @amalia-oss/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.
```
npm install --save-dev @amalia-oss/nx-remotecache-gcs
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.
`shell`
gcloud auth application-default login
The procedure for an automated environment such as a CI/CD can differ.
| Parameter | Description | Environment Variable | nx.json |NX_REMOTE_CACHE_BUCKET
| ----------- | ----------------------------------------------------- | ------------------------ | ------------ |
| Bucket Name | The name of your GCS bucket to use as cache container | | 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:
`json`
{
"tasksRunnerOptions": {
"default": {
"runner": "@amalia-oss/nx-remotecache-gcs",
"options": {
"bucketName": "my-bucket-name",
"cacheableOperations": ["build", "test", "lint", "e2e"]
}
}
}
}
`json``
{
"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"
}
}
}
}