1
|
-'use strict';
|
|
|
2
|
-
|
|
|
3
|
-const path = require('path');
|
|
|
4
|
-
|
|
|
5
|
-const gulp = require('gulp');
|
|
|
6
|
-const qiniu = require('gulp-qiniu');
|
|
|
7
|
-
|
|
|
8
|
-
|
|
|
9
|
-gulp.task('upQiniu', () => {
|
|
|
10
|
- let args = process.argv.slice(3);
|
|
|
11
|
-
|
|
|
12
|
- let name = args[0].replace('--name=', '');
|
|
|
13
|
- let time = args[1].replace('--time=', '');
|
|
|
14
|
-
|
|
|
15
|
- if (!name || !time) {
|
|
|
16
|
- return;
|
|
|
17
|
- }
|
|
|
18
|
-
|
|
|
19
|
- // 找到对应项目对应的版本的静态资源上传至七牛cdn
|
|
|
20
|
- gulp.src(path.join(__dirname, `../../packages/${name}/${time}/${name}/**`)).pipe(
|
|
|
21
|
- qiniu({
|
|
|
22
|
- accessKey: 'RcJ--8b9E4ND8J_SRPsWvb4lGqK3cr92gKi5xmuF', //cY9B5ZgON_7McTS5zV5nTeRyQ98MOcVD7W4eGVbE
|
|
|
23
|
- secretKey: 'xfFfRTdje-LxoPSQH619PeGtcJZT19UNCwXGTOfo', //RduqgmK7cAtaQvdIa1ax_zzmMsnv9ac-Ka0uF6wG
|
|
|
24
|
- bucket: 'yohotest' //yohocdn
|
|
|
25
|
- }, {
|
|
|
26
|
- dir: name
|
|
|
27
|
- })
|
|
|
28
|
- );
|
1
|
+'use strict';
|
|
|
2
|
+
|
|
|
3
|
+const path = require('path');
|
|
|
4
|
+
|
|
|
5
|
+const gulp = require('gulp');
|
|
|
6
|
+const qiniu = require('gulp-qiniu');
|
|
|
7
|
+
|
|
|
8
|
+
|
|
|
9
|
+gulp.task('upQiniu', () => {
|
|
|
10
|
+ let args = process.argv.slice(3);
|
|
|
11
|
+
|
|
|
12
|
+ let name = args[0].replace('--name=', '');
|
|
|
13
|
+ let time = args[1].replace('--time=', '');
|
|
|
14
|
+
|
|
|
15
|
+ if (!name || !time) {
|
|
|
16
|
+ return;
|
|
|
17
|
+ }
|
|
|
18
|
+
|
|
|
19
|
+ // 找到对应项目对应的版本的静态资源上传至七牛cdn
|
|
|
20
|
+ gulp.src(path.join(__dirname, `../../packages/${name}/${time}/${name}/**`)).pipe(
|
|
|
21
|
+ qiniu({
|
|
|
22
|
+ // accessKey: 'RcJ--8b9E4ND8J_SRPsWvb4lGqK3cr92gKi5xmuF',
|
|
|
23
|
+ accessKey: 'cY9B5ZgON_7McTS5zV5nTeRyQ98MOcVD7W4eGVbE',
|
|
|
24
|
+ // secretKey: 'xfFfRTdje-LxoPSQH619PeGtcJZT19UNCwXGTOfo',
|
|
|
25
|
+ secretKey: 'RduqgmK7cAtaQvdIa1ax_zzmMsnv9ac-Ka0uF6wG',
|
|
|
26
|
+ // bucket: 'yohotest'
|
|
|
27
|
+ bucket: 'yohocdn'
|
|
|
28
|
+ }, {
|
|
|
29
|
+ dir: name
|
|
|
30
|
+ })
|
|
|
31
|
+ );
|
29
|
}); |
32
|
}); |