|
@@ -11,7 +11,9 @@ import md5 from 'md5'; |
|
@@ -11,7 +11,9 @@ import md5 from 'md5'; |
11
|
import {Hotfix} from '../../models';
|
11
|
import {Hotfix} from '../../models';
|
12
|
import qn from '../../../lib/qiniu'
|
12
|
import qn from '../../../lib/qiniu'
|
13
|
import path from 'path';
|
13
|
import path from 'path';
|
14
|
-import Operation from '../../logger/operation';
|
14
|
+import Operation from '../../logger/operation'
|
|
|
15
|
+
|
|
|
16
|
+const env = process.env.NODE_ENV || 'development';
|
15
|
|
17
|
|
16
|
let r = new Router();
|
18
|
let r = new Router();
|
17
|
|
19
|
|
|
@@ -60,14 +62,14 @@ const hf = { |
|
@@ -60,14 +62,14 @@ const hf = { |
60
|
time: new Date()
|
62
|
time: new Date()
|
61
|
};
|
63
|
};
|
62
|
|
64
|
|
63
|
- let batchKey = `app-hotfix2/${appName}/${type.toLowerCase()}/${appVersion}`;
|
65
|
+ let batchKey = `app-hotfix2/${env}/${appName}/${type.toLowerCase()}/${appVersion}`;
|
64
|
|
66
|
|
65
|
if (patchVersion) {
|
67
|
if (patchVersion) {
|
66
|
batchKey = path.join(batchKey, patchVersion);
|
68
|
batchKey = path.join(batchKey, patchVersion);
|
67
|
}
|
69
|
}
|
68
|
batchKey = path.join(batchKey, batchFile.name);
|
70
|
batchKey = path.join(batchKey, batchFile.name);
|
69
|
|
71
|
|
70
|
- let apiFileKey = `app-hotfix2/${appName}/${type.toLowerCase()}/${appVersion}/api.json`;
|
72
|
+ let apiFileKey = `app-hotfix2/${env}/${appName}/${type.toLowerCase()}/${appVersion}/api.json`;
|
71
|
let batchUpload = await qn.uploadFileAsync(batchFile.path, {key: batchKey});
|
73
|
let batchUpload = await qn.uploadFileAsync(batchFile.path, {key: batchKey});
|
72
|
|
74
|
|
73
|
if (batchUpload && batchUpload.url) {
|
75
|
if (batchUpload && batchUpload.url) {
|