gulpfile.js 897 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: 'RcJ--8b9E4ND8J_SRPsWvb4lGqK3cr92gKi5xmuF',
            accessKey: 'cY9B5ZgON_7McTS5zV5nTeRyQ98MOcVD7W4eGVbE',
            // secretKey: 'xfFfRTdje-LxoPSQH619PeGtcJZT19UNCwXGTOfo',
            secretKey: 'RduqgmK7cAtaQvdIa1ax_zzmMsnv9ac-Ka0uF6wG',
            // bucket: 'yohotest'
            bucket: 'yohocdn'
        }, {
            dir: name
        })
    );
});