Commit d2670c0f authored by 智勇's avatar 智勇

update

parent 32ac4c40
......@@ -93,15 +93,15 @@ function parseJson2Str(json) {
function getProjectConfigPromise() {
return new Promise(function (resolve, reject) {
// mongoose.model("ProConfig",new mongoose.Schema({}))
ProConfig.find({is_active:true}).exec().then(res => {
ProConfig.find({ is_active: true }).exec().then(res => {
let _pros = JSON.parse(JSON.stringify(res));
let re = {}, hosts = {};
for (let pro of _pros) {
hosts[pro["project_name"]] = pro["host_name"];
// if (pro["project_name"] == "xjd-ui") {
// hosts["xyqb-ui--xjd-ui"] = pro["host_name"];
// } else
if (pro["project_name"] == "new-paycenter-ui") {
// hosts["xyqb-ui--xjd-ui"] = pro["host_name"];
// } else
if (pro["project_name"] == "new-paycenter-ui") {
hosts["paycenter-ui--new-paycenter-ui"] = pro["host_name"];
}
......@@ -283,10 +283,10 @@ function getfrontendbackend(pros) {
// && pro.name != "spider-center-ui" pro.name != "xyqb-ui" &&
if (pro.name != "paycenter-ui") {
// if (pro.name == "xjd-ui") {
// temp.frontend.push("xyqb-ui--xjd-ui");
// temp[pro.type].push("xyqb-ui--xjd-ui")
// } else
if (pro.name == "new-paycenter-ui") {
// temp.frontend.push("xyqb-ui--xjd-ui");
// temp[pro.type].push("xyqb-ui--xjd-ui")
// } else
if (pro.name == "new-paycenter-ui") {
temp.frontend.push("paycenter-ui--new-paycenter-ui");
temp[pro.type].push("paycenter-ui--new-paycenter-ui")
}
......@@ -364,15 +364,15 @@ admin.get('/get_namespace_by_type_for_jenkins/:_type', async function (req, res)
res.send(ns_array.join("\n"));
});
// 获取这个服务的所有配置
admin.get('/get_config/:_name',async function(req,res) {
let config = await getProjectConfigPromiseByDb({project_name:req.params._name});
res.send(config[0])
admin.get('/get_config/:_name', async function (req, res) {
let config = await getProjectConfigPromiseByDb({ project_name: req.params._name });
res.send(config[0])
})
// 给jenkins使用获取服务groupname_projectname
admin.get('/get_groupname_by_type_for_jenkins/:_type', async function (req, res) {
let configs = await getProjectConfigPromiseByDb({is_active:true});
let configs = await getProjectConfigPromiseByDb({ is_active: true });
let re = {
ui: [],
java: [],
......@@ -382,13 +382,13 @@ admin.get('/get_groupname_by_type_for_jenkins/:_type', async function (req, res)
let xjdui = [["", ""], ["", ""]], payui = [["", ""], ["", ""]]
for (let o of configs) {
// if (o.project_name == "xyqb-ui") {
// xjdui[0][0] = o.git_path_group
// xjdui[1][0] = o.project_name
// } else if (o.project_name == "xjd-ui") {
// xjdui[0][0] = o.git_path_group
// xjdui[1][0] = o.project_name
// } else if (o.project_name == "xjd-ui") {
// xjdui[0][1] = o.git_path_group
// xjdui[1][1] = o.project_name
// } else
if (o.project_name == "paycenter-ui") {
if (o.project_name == "paycenter-ui") {
payui[0][0] = o.git_path_group
payui[1][0] = o.project_name
} else if (o.project_name == "new-paycenter-ui") {
......@@ -408,9 +408,10 @@ admin.get('/get_groupname_by_type_for_jenkins/:_type', async function (req, res)
}
let lua_ui = [], cb = "";
if (req.params._type == "lua_ui") {
lua_ui.push(getLuaUiStr(xjdui));
// lua_ui.push(getLuaUiStr(xjdui));
lua_ui.push(getLuaUiStr(payui));
cb = lua_ui.join("\n");
res.send(cb);
} else {
res.send(re[req.params._type].join("\n"));
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment