1.6.2 • Published 4 years ago

cdn-upload v1.6.2

Weekly downloads
10
License
ISC
Repository
github
Last release
4 years ago

cdn-upload

Synchronize all files in your specified local directory to the CDN (currently only supports qiniu)

Installation

  $ npm install -g cdn-upload

Usage

  Usage: cdn-upload <config path> [env]

  Upload file to cdn. the default configuration path for the configuration file is config/cdn_upload.json


  Options:

    -V, --version  output the version number
    -s, --sync     Make sure the local uploaded files is the same as the cdn files
    -h, --help     output usage information

  Examples:

    $ cdn-upload config/cdn_upload.json beta
    

Test

  npm run test // run this command before ensure .env was configured and available

Configuration

config/upload_assets.json:

{
  "default": {
    "cachedFile": "../build/assets_cache.json",
    "localDirectory": "../public",
    "remoteDirectory": "test/public",
    "bucket": "your cdn bucket",
    "cdn": "qiniu",
    "envFile": ".env",
    "ignore": ['a.html', 'b/**/**'], // glob ignore sytax that a.html is localdirectory/a.html and b/**/** will localdirectory/b/**/**
    "concurrency": 8 // Number of concurrent processes (default: cpu count)
  },
  "beta": {
    "remoteDirectory": "test/beta/public",
    "concurrency": 4
  },
  "release": {
    "remoteDirectory": "test/release/public",
    "concurrency": 8
  },
  "production": {
    "remoteDirectory": "test/production/public",
    "concurrency": 16
  }
}

.env:

QINIU_ACCESS_KEY="qiniu access key"
QINIU_SECRET_KEY="qiniu secret key"

You should add .env and assets_cache.json files in .gitignore.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/gaogao1030/cdn-upload.

1.6.2

4 years ago

1.6.0

5 years ago

1.5.1

5 years ago

1.5.0

5 years ago

1.3.0

5 years ago

1.2.3

5 years ago

1.2.2

6 years ago

1.2.1

6 years ago

1.2.0

6 years ago

1.1.9

6 years ago

1.1.8

6 years ago

1.1.7

6 years ago

1.1.6

6 years ago

1.1.5

6 years ago

1.1.3

6 years ago

1.1.2

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.5

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago