@amalia-oss/nx-remotecache-gcs
TypeScript icon, indicating that this package has built-in type declarations

2.0.0 • Public • Published

nx-remotecache-gcs

version

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

See nx-remotecache-custom.

{
  "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"
      }
    }
  }
}

Inspirations

Readme

Keywords

none

Package Sidebar

Install

npm i @amalia-oss/nx-remotecache-gcs

Weekly Downloads

890

Version

2.0.0

License

MIT

Unpacked Size

8.74 kB

Total Files

11

Last publish

Collaborators

  • svc-tech-amalia-io