Giter Site home page Giter Site logo

nx-remotecache-qiniu's Introduction

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.