Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qa-deploy-utils
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
QA
qa-deploy-utils
Commits
4b5f2fe7
Commit
4b5f2fe7
authored
Aug 09, 2018
by
qa_quantgroup
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://git.quantgroup.cn/QA/qa-deploy-utils
parents
c5c5b127
8d53b583
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
17 deletions
+18
-17
get_project_config_server.js
qa_shell_script/config_server/get_project_config_server.js
+18
-17
No files found.
qa_shell_script/config_server/get_project_config_server.js
View file @
4b5f2fe7
...
@@ -93,15 +93,15 @@ function parseJson2Str(json) {
...
@@ -93,15 +93,15 @@ function parseJson2Str(json) {
function
getProjectConfigPromise
()
{
function
getProjectConfigPromise
()
{
return
new
Promise
(
function
(
resolve
,
reject
)
{
return
new
Promise
(
function
(
resolve
,
reject
)
{
// mongoose.model("ProConfig",new mongoose.Schema({}))
// 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
_pros
=
JSON
.
parse
(
JSON
.
stringify
(
res
));
let
re
=
{},
hosts
=
{};
let
re
=
{},
hosts
=
{};
for
(
let
pro
of
_pros
)
{
for
(
let
pro
of
_pros
)
{
hosts
[
pro
[
"
project_name
"
]]
=
pro
[
"
host_name
"
];
hosts
[
pro
[
"
project_name
"
]]
=
pro
[
"
host_name
"
];
// if (pro["project_name"] == "xjd-ui") {
// if (pro["project_name"] == "xjd-ui") {
// hosts["xyqb-ui--xjd-ui"] = pro["host_name"];
// hosts["xyqb-ui--xjd-ui"] = pro["host_name"];
// } else
// } else
if
(
pro
[
"
project_name
"
]
==
"
new-paycenter-ui
"
)
{
if
(
pro
[
"
project_name
"
]
==
"
new-paycenter-ui
"
)
{
hosts
[
"
paycenter-ui--new-paycenter-ui
"
]
=
pro
[
"
host_name
"
];
hosts
[
"
paycenter-ui--new-paycenter-ui
"
]
=
pro
[
"
host_name
"
];
}
}
...
@@ -296,10 +296,10 @@ function getfrontendbackend(pros) {
...
@@ -296,10 +296,10 @@ function getfrontendbackend(pros) {
// && pro.name != "spider-center-ui" pro.name != "xyqb-ui" &&
// && pro.name != "spider-center-ui" pro.name != "xyqb-ui" &&
if
(
pro
.
name
!=
"
paycenter-ui
"
)
{
if
(
pro
.
name
!=
"
paycenter-ui
"
)
{
// if (pro.name == "xjd-ui") {
// if (pro.name == "xjd-ui") {
// temp.frontend.push("xyqb-ui--xjd-ui");
// temp.frontend.push("xyqb-ui--xjd-ui");
// temp[pro.type].push("xyqb-ui--xjd-ui")
// temp[pro.type].push("xyqb-ui--xjd-ui")
// } else
// } else
if
(
pro
.
name
==
"
new-paycenter-ui
"
)
{
if
(
pro
.
name
==
"
new-paycenter-ui
"
)
{
temp
.
frontend
.
push
(
"
paycenter-ui--new-paycenter-ui
"
);
temp
.
frontend
.
push
(
"
paycenter-ui--new-paycenter-ui
"
);
temp
[
pro
.
type
].
push
(
"
paycenter-ui--new-paycenter-ui
"
)
temp
[
pro
.
type
].
push
(
"
paycenter-ui--new-paycenter-ui
"
)
}
}
...
@@ -377,15 +377,15 @@ admin.get('/get_namespace_by_type_for_jenkins/:_type', async function (req, res)
...
@@ -377,15 +377,15 @@ admin.get('/get_namespace_by_type_for_jenkins/:_type', async function (req, res)
res
.
send
(
ns_array
.
join
(
"
\n
"
));
res
.
send
(
ns_array
.
join
(
"
\n
"
));
});
});
// 获取这个服务的所有配置
// 获取这个服务的所有配置
admin
.
get
(
'
/get_config/:_name
'
,
async
function
(
req
,
res
)
{
admin
.
get
(
'
/get_config/:_name
'
,
async
function
(
req
,
res
)
{
let
config
=
await
getProjectConfigPromiseByDb
({
project_name
:
req
.
params
.
_name
});
let
config
=
await
getProjectConfigPromiseByDb
({
project_name
:
req
.
params
.
_name
});
res
.
send
(
config
[
0
])
res
.
send
(
config
[
0
])
})
})
// 给jenkins使用获取服务groupname_projectname
// 给jenkins使用获取服务groupname_projectname
admin
.
get
(
'
/get_groupname_by_type_for_jenkins/:_type
'
,
async
function
(
req
,
res
)
{
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
=
{
let
re
=
{
ui
:
[],
ui
:
[],
java
:
[],
java
:
[],
...
@@ -395,13 +395,13 @@ admin.get('/get_groupname_by_type_for_jenkins/:_type', async function (req, res)
...
@@ -395,13 +395,13 @@ admin.get('/get_groupname_by_type_for_jenkins/:_type', async function (req, res)
let
xjdui
=
[[
""
,
""
],
[
""
,
""
]],
payui
=
[[
""
,
""
],
[
""
,
""
]]
let
xjdui
=
[[
""
,
""
],
[
""
,
""
]],
payui
=
[[
""
,
""
],
[
""
,
""
]]
for
(
let
o
of
configs
)
{
for
(
let
o
of
configs
)
{
// if (o.project_name == "xyqb-ui") {
// if (o.project_name == "xyqb-ui") {
// xjdui[0][0] = o.git_path_group
// xjdui[0][0] = o.git_path_group
// xjdui[1][0] = o.project_name
// xjdui[1][0] = o.project_name
// } else if (o.project_name == "xjd-ui") {
// } else if (o.project_name == "xjd-ui") {
// xjdui[0][1] = o.git_path_group
// xjdui[0][1] = o.git_path_group
// xjdui[1][1] = o.project_name
// xjdui[1][1] = o.project_name
// } else
// } else
if
(
o
.
project_name
==
"
paycenter-ui
"
)
{
if
(
o
.
project_name
==
"
paycenter-ui
"
)
{
payui
[
0
][
0
]
=
o
.
git_path_group
payui
[
0
][
0
]
=
o
.
git_path_group
payui
[
1
][
0
]
=
o
.
project_name
payui
[
1
][
0
]
=
o
.
project_name
}
else
if
(
o
.
project_name
==
"
new-paycenter-ui
"
)
{
}
else
if
(
o
.
project_name
==
"
new-paycenter-ui
"
)
{
...
@@ -421,9 +421,10 @@ admin.get('/get_groupname_by_type_for_jenkins/:_type', async function (req, res)
...
@@ -421,9 +421,10 @@ admin.get('/get_groupname_by_type_for_jenkins/:_type', async function (req, res)
}
}
let
lua_ui
=
[],
cb
=
""
;
let
lua_ui
=
[],
cb
=
""
;
if
(
req
.
params
.
_type
==
"
lua_ui
"
)
{
if
(
req
.
params
.
_type
==
"
lua_ui
"
)
{
lua_ui
.
push
(
getLuaUiStr
(
xjdui
));
//
lua_ui.push(getLuaUiStr(xjdui));
lua_ui
.
push
(
getLuaUiStr
(
payui
));
lua_ui
.
push
(
getLuaUiStr
(
payui
));
cb
=
lua_ui
.
join
(
"
\n
"
);
cb
=
lua_ui
.
join
(
"
\n
"
);
res
.
send
(
cb
);
}
else
{
}
else
{
res
.
send
(
re
[
req
.
params
.
_type
].
join
(
"
\n
"
));
res
.
send
(
re
[
req
.
params
.
_type
].
join
(
"
\n
"
));
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment