Authored by 姜枫

hotfix file path add the env

... ... @@ -11,7 +11,9 @@ import md5 from 'md5';
import {Hotfix} from '../../models';
import qn from '../../../lib/qiniu'
import path from 'path';
import Operation from '../../logger/operation';
import Operation from '../../logger/operation'
const env = process.env.NODE_ENV || 'development';
let r = new Router();
... ... @@ -60,14 +62,14 @@ const hf = {
time: new Date()
};
let batchKey = `app-hotfix2/${appName}/${type.toLowerCase()}/${appVersion}`;
let batchKey = `app-hotfix2/${env}/${appName}/${type.toLowerCase()}/${appVersion}`;
if (patchVersion) {
batchKey = path.join(batchKey, patchVersion);
}
batchKey = path.join(batchKey, batchFile.name);
let apiFileKey = `app-hotfix2/${appName}/${type.toLowerCase()}/${appVersion}/api.json`;
let apiFileKey = `app-hotfix2/${env}/${appName}/${type.toLowerCase()}/${appVersion}/api.json`;
let batchUpload = await qn.uploadFileAsync(batchFile.path, {key: batchKey});
if (batchUpload && batchUpload.url) {
... ...
... ... @@ -13,7 +13,7 @@ const defaults = {
const specific = {
development: {},
test: {},
production: {},
production: {}
};
export default Object.assign(defaults, specific[env]);
\ No newline at end of file
... ...