nx-remotecache-qiniu
TypeScript icon, indicating that this package has built-in type declarations

2.0.0 • Public • Published

npm package link

nx-remotecache-qiniu

中文文档 | 英文文档

nx-remotecache-qiniu is an innovative task runner for @nrwl/nx that leverages Qiniu Cloud Storage to create a remote cache. This unique approach allows all team members and CI servers to share a single cache, greatly enhancing efficiency and collaboration.

This package was built with nx-remotecache-custom 🙌

Features

  • Utilizes Qiniu Cloud Storage as a remote cache.
  • Enables cache sharing among team members and CI servers.
  • Built with nx-remotecache-custom.

Compatability

Nx Remote Cache
>= 17.0.0 <18 >= 1.0.0
>= 18.0.0 < 19 >= 2.0.0

Installation

To install, run the following command in your project directory:

npm install --save-dev nx-remotecache-qiniu

Setups

  1. Add Nx to your workspace guide

  2. npm install --save-dev nx-remotecache-qiniu

  3. (Required)Obtaining Qiniu Cloud Keys

    You can apply for keys at Qiniu Key Portal. Note that an individual can apply for up to 2 keys. For multiple users, create a Qiniu account and set sharing permissions in the created space.

    Qiniu Cloud and Zone Information

  4. Creating a Bucket in Qiniu Cloud:

    • Visit Qiniu Cloud Bucket Creation to create a new bucket.
    • Choose the appropriate region for your bucket. You can refer to the region and endpoint information at Qiniu Cloud Region and Endpoint. Remember to note the Region ID.
    • Upon successful creation of the bucket, you will receive a test domain from Qiniu Cloud.
  5. Customizing CDN Domain:

    • 2.1 (Optional) Apply for a domain if you do not already own one.
    • 2.2 Domain Record Filing:
    • 2.3 Configuring EV SSL Certificate for Your Domain:
      • Ensure your domain has an Extended Validation (EV) SSL Certificate for secure connections.
    • 2.4 Configuring CNAME Record for Custom CDN Domain:
      • Set up a CNAME record in your domain's DNS settings to enable your custom CDN domain.

Configuration

The nx-remotecache-qiniu requires the following options to be set:

Parameter Description Environment Variable nx.json Notes
accessKey Qiniu Cloud accessKey NXCACHE_ACCESS_KEY accessKey Obtain from the Qiniu Cloud management console
secretKey Qiniu Cloud secretKey NXCACHE_SECRET_KEY secretKey Obtain from the Qiniu Cloud management console
bucket Storage Bucket NXCACHE_BUCKET bucket
domain Access Domain NXCACHE_DOMAIN domain CDN acceleration is recommended
zone Zone NXCACHE_ZONE zone Corresponds to the lowercase ZoneID
private Private Bucket Option (true/false) NXCACHE_PRIVATE private Default is false, optional attribute
expires Cache Expiration Time (in seconds) NXCACHE_EXPIRES expires Default is 3600, set to 0 for updating the uploadToken always

You can also use environment variables prefixed with NXCACHE_. Here's a format similar to the one you requested.

Now, let's move on to the Chinese version of the document.

nx.json Configuration Demo, configure nx.json as follows:

"tasksRunnerOptions": {
  "default": {
    "runner": "nx-remotecache-qiniu",
    "options": {
      "accessKey": "your_access_key",
      "secretKey": "your_secret_key",
      "bucket": "your_bucket_name",
      "domain": "your_domain",
      "zone": "your_zone",
      "private": true_or_false,
      "expires": expiration_time
    }
  }
}

Run it

Store files:

------------------------------------------------------------------------------
Stored output to remote cache: Nx Qiniu Cloud Storage - nx-remotecache-qiniu plugin
File: 14911649122709785563.tar.gz
------------------------------------------------------------------------------

Retreive files:

------------------------------------------------------------------------------
Remote cache hit: Nx Qiniu Cloud Storage - nx-remotecache-qiniu plugin
File: 14911649122709785563.tar.gz
------------------------------------------------------------------------------

> nx run header:build  [remote cache]

Advanced Configuration

See nx-remotecache-custom.

Package Sidebar

Install

npm i nx-remotecache-qiniu

Weekly Downloads

0

Version

2.0.0

License

MIT

Unpacked Size

12.1 kB

Total Files

4

Last publish

Collaborators

  • imcbrian