gulpfile.js
723 Bytes
'use strict';
const path = require('path');
const gulp = require('gulp');
const qiniu = require('gulp-qiniu');
gulp.task('upQiniu', () => {
let args = process.argv.slice(3);
let name = args[0].replace('--name=', '');
let time = args[1].replace('--time=', '');
if (!name || !time) {
return;
}
// 找到对应项目对应的版本的静态资源上传至七牛cdn
gulp.src(path.join(__dirname, `../../packages/${name}/${time}/${name}/**`)).pipe(
qiniu({
accessKey: 'cY9B5ZgON_7McTS5zV5nTeRyQ98MOcVD7W4eGVbE',
secretKey: 'RduqgmK7cAtaQvdIa1ax_zzmMsnv9ac-Ka0uF6wG',
bucket: 'yohocdn'
}, {
dir: name
})
);
});