-
Notifications
You must be signed in to change notification settings - Fork 401
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Feature] Unified Front and back end (#192)
* fix ui deploy * add npmDownloadRoot * fix:修复运行报错问题 * feat:将前端产物“搬运”到指定目录 * feat:publicPath设置(/${path},后端配置) * replace path to /ddh * feat:前端文件移动,路径配置(/ddh) * fix ui deploy * revert some code * revert some code * [Improvement-190][MinaUtils] Improve get id_rsa file path to support different user home path on MinaUtils (#191) * 1.delete read hosts file code and host_ip/ip_host cache 2.add utils get ip and hostname use InetAddress 3.delete unused code related this functions * Improve get id_rsa file path on MinaUtils --------- Co-authored-by: chenshaosong <chenss131@chinaunicom.cn> * perf: Remove constant Constants.ID/ALERT_GROUP_ID/ALERT_QUOTA_NAME/ALERT_GROUP_NAME/ALERT_LEVEL, and use SFunction instead. (#200) * A bug fix for querying the list of all service roles (#202) * perf: Remove constant Constants.ID/ALERT_GROUP_ID/ALERT_QUOTA_NAME/ALERT_GROUP_NAME/ALERT_LEVEL, and use SFunction instead. * fix: NullpointerException will be thrown, when target value of query is null. * add options.mode = 'history' * add options.mode = 'history' * revert * fix some error --------- Co-authored-by: huangli <huangli@iflytek.com> Co-authored-by: chenss <shaosongfirst@163.com> Co-authored-by: chenshaosong <chenss131@chinaunicom.cn> Co-authored-by: renwujie <rwj005@outlook.com>
- Loading branch information
1 parent
bfa3d1d
commit 8931221
Showing
12 changed files
with
279 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,3 +37,6 @@ config.gypi | |
test/coverage | ||
/docs/zh_CN/介绍 | ||
/docs/zh_CN/贡献代码.md | ||
|
||
front/ | ||
node/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
const PATH = '../datasophon-api/src/main/resources/front/' | ||
|
||
module.exports = [ | ||
{ | ||
source: './dist', | ||
clean: true, | ||
target: `${PATH}/static/resources/bundle-main`, | ||
}, | ||
{ | ||
source: './dist/index.html', | ||
target: `${PATH}/views/index.html`, | ||
replace: [{ pattern: /\/static\//g, replacement: '/static/' }], | ||
}, | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
const fs = require('fs-extra') | ||
const path = require('path') | ||
const deployTasks = require('./deploy.config.js') | ||
|
||
// 将前端产物“搬运”到指定目录 | ||
console.log(deployTasks) | ||
const promisedDeployTasks = deployTasks.map((deployTask) => { | ||
const { clean, source, target, replace } = deployTask | ||
return new Promise((resolve, reject) => { | ||
if (!source || !target) { | ||
return reject(new Error('必须指定 ${source} 和 ${target} !')) | ||
} | ||
try { | ||
const stat = fs.lstatSync(source) | ||
if (clean === true) { | ||
// 显式指定clean时,将目标目录清空 | ||
fs.emptyDirSync(path.resolve(__dirname, target)) | ||
} | ||
if (!stat.isFile()) { | ||
fs.copySync( | ||
path.resolve(__dirname, source), | ||
path.resolve(__dirname, target) | ||
) | ||
} | ||
if (stat.isFile() && replace) { | ||
let content = fs.readFileSync(source, 'utf-8') | ||
replace.forEach((item) => { | ||
content = content.replace(item.pattern, item.replacement) | ||
}) | ||
fs.outputFileSync(target, content) | ||
} | ||
resolve() | ||
} catch (e) { | ||
reject(e) | ||
} | ||
}) | ||
}) | ||
|
||
async function runTasks() { | ||
async function runner() { | ||
for (const task of promisedDeployTasks) { | ||
await task | ||
} | ||
} | ||
try { | ||
await runner() | ||
console.log('部署完成!') | ||
} catch (e) { | ||
console.error('部署失败!') | ||
console.log(e) | ||
} | ||
} | ||
|
||
runTasks() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.