5.0.3 • Published 4 months ago

@pellegrims/nx-remotecache-s3 v5.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
4 months ago

npm package link

@pellegrims/nx-remotecache-s3

A task runner for @nrwl/nx that uses s3 storage as a remote cache. This 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 🙌

Setup

npm install --save-dev @pellegrims/nx-remotecache-s3
ParameterDescriptionEnvironment Variable / .envnx.json
EndpointOptional. The fully qualified endpoint of the webservice. This is only required when using a custom (non-AWS) endpoint.NXCACHE_S3_ENDPOINTendpoint
BucketOptional. Specify which bucket should be used for storing the cache.NXCACHE_S3_BUCKETbucket
PrefixOptional. Specify prefix path of target object key.NXCACHE_S3_PREFIXprefix
RegionOptional. The AWS region to which this client will send requests.NXCACHE_S3_REGIONregion
ProfileOptional. The AWS profile to use to authenticate.NXCACHE_S3_PROFILEprofile
Force Path StyleOptional. Whether to force path style URLs for S3 objects (e.g., https://s3.amazonaws.com/<bucket>/ instead of https://<bucket>.s3.amazonaws.com/NXCACHE_S3_FORCE_PATH_STYLEforcePathStyle
Read OnlyOptional. Disable writing cache to the S3 bucket. This may be useful if you only want to write to the cache from a CI but not localhost.NXCACHE_S3_READ_ONLYreadOnly
{
  "tasksRunnerOptions": {
    "default": {
      "runner": "@pellegrims/nx-remotecache-s3",
      "options": {
        "cacheableOperations": ["build", "test", "lint", "e2e"],
        "endpoint": "https://some-endpoint.com",
        "bucket": "name-of-bucket",
        "prefix": "prefix/",
        "region": "us-west-000",
        "profile": "name-of-aws-profile",
        "forcePathStyle": true,
        "readOnly": false
      }
    }
  }
}

Authentication is handled by @aws-sdk/credential-provider-node, so credentials will be attempted to be found from the following sources (listed in order of precedence):

  • Environment variables exposed via process.env (example: AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY)
  • SSO credentials from token cache
  • Web identity token credentials
  • Shared credentials and config ini files
  • The EC2/ECS Instance Metadata Service

Run it 🚀

Running tasks should now show the storage or retrieval from the remote cache:

------------------------------------------------------------------------
Built Angular Package
 - from: /Users/name/example-workspace/libs/example-lib
 - to:   /Users/name/example-workspace/dist/libs/example-lib
------------------------------------------------------------------------
------------------------------------------------------------------------
Stored output to remote cache: s3 storage
Hash: d3d2bea71ea0f3004304c5cc88cf91be50b02bb636ebbdfcc927626fd8edf1ae
------------------------------------------------------------------------

Advanced Configuration

See nx-remotecache-custom.

More Custom Runners

See nx-remotecache-custom.

5.0.3

4 months ago

5.0.2

5 months ago

5.0.1

5 months ago

3.0.1

9 months ago

4.0.0

7 months ago

5.0.0

6 months ago

3.0.0

11 months ago

2.1.2

12 months ago

2.1.1

12 months ago

2.1.3

11 months ago

2.0.3

1 year ago

2.0.2

1 year ago

2.1.0

1 year ago

2.0.1

1 year ago

1.4.6

1 year ago

1.5.2

1 year ago

1.5.1

1 year ago

1.5.0

1 year ago

2.0.0

1 year ago

1.4.7

1 year ago

1.4.5

1 year ago

1.4.4

1 year ago

1.4.3

1 year ago

1.4.2

1 year ago

1.4.1

1 year ago

1.2.3

2 years ago

1.4.0

2 years ago

1.3.0

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.2.2

2 years ago

1.2.1

2 years ago

1.0.6

2 years ago

1.0.5

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

0.3.0

2 years ago

0.2.1

2 years ago

0.2.3

2 years ago

0.3.1

2 years ago

0.2.2

2 years ago

0.2.0

2 years ago

0.1.8

2 years ago

0.1.7

2 years ago

0.1.6

2 years ago

0.1.5

2 years ago

0.1.4

2 years ago

0.1.3

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago