ali-oss-deploy-with-version
Install
3 ways:
-
clone this repo, and require
./index.js
-
npm install --save-dev ali-oss-deploy-with-version
-
yarn add --dev ali-oss-deploy-with-version
Usage
const deploy2OSS = const OSS = const path = const OSSClient = region: "" bucket: "" accessKeyId: "" accessKeySecret: ""const currentVersion = "20181106"
local files:
dist/
|-- hello/
|-- hi.js
|-- index.html
|-- index.js
files deployed with version 20181106
on ali-oss:
demo/
|-- 20181106/
|-- hello/
|-- hi.js
|-- index.html
|-- index.js
|-- test/
|-- index.txt
|-- index.html
|-- info.json
API
deploy2OSS
function deploy2OSS
will return promise to recieve wheather all job done success.
const deploy2OSS = // Or require from packageconst deploy2OSS =
aliOSSInstance:
const OSS = const aliOSSInstance = region: "" bucket: "" accessKeyId: "" accessKeySecret: ""
options:
-
localFolderPath: Mandatory.
-
aliOSSBasePath: Mandatory.
-
aliOSSFolderName: Optional.
-
filesAlsoCopy2Base: Optional.
Array<RegExp>
. Files matched RegExp will copy to aliOSSBaseFolder. -
extendedFiles: Optional.
Array<Object>
. Define content will be created and upload to ali-oss.Each element has propertyfilename
andcontent
.filename
is path relative to aliOSSBasePath. -
rename: Optional. A function that receive file path relative to
localFolderPath
and return a new file path.
License
MIT