2.0.0 • Published 2 years ago

@amalia-oss/nx-remotecache-gcs v2.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

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

ParameterDescriptionEnvironment Variablenx.json
Bucket NameThe name of your GCS bucket to use as cache containerNX_REMOTE_CACHE_BUCKETbucketName

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

1.1.0

2 years ago

2.0.0

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago