qcloud-uploader-cli
v2.2.0
Published
upload your files to cloud, not just qlocud, but also aws s3.
Downloads
16
Readme
qcloud-uploader-cli
upload your files to cloud, not just qlocud, but also aws s3.
Env config
const config = {
s3: {
bucket: process.env.S3_BUCKET
},
qcloud: {
sid: process.env.QCLOUD_SID,
skey: process.env.QCLOUD_SKEY,
bucket: process.env.QCLOUD_BUCKET,
region: process.env.QCLOUD_REGION || process.env.QCLOUD_REGIEON
}
}
Just set IAM roles for your server, see IAM Roles
Usage
Upload a local directory to remote bucket
qcloud-uploader-cli -r ./build -n remoteDirName
Upload a local file to remote bucket
qcloud-uploader-cli -s android.apk -d androids/v3.3.3.apk
Demo
./cli.js -r test -n static/sub
Output
{
"s3": {
"bucket": "xxx"
},
"qcloud": {
"sid": "xxx",
"skey": "xxx",
"bucket": "xxx",
"region": "xxxx"
}
}
Start uploading directory: /Users/simonxu/qcloud-uploader-cli/test
Uploading file: static/sub/1.txt
Uploading file: static/sub/2.text
Uploading file: static/sub/sub/sub.txt
**** upload cos success = static/sub/2.text ****
**** upload cos success = static/sub/1.txt ****
**** upload cos success = static/sub/sub/sub.txt ****
**** upload aws success = static/sub/1.txt ****
**** upload aws success = static/sub/2.text ****
**** upload aws success = static/sub/sub/sub.txt ****
Complete uploading file!