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
01510169
Commit
01510169
authored
Apr 08, 2018
by
tywldx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
f
parent
7802ed6d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
55 additions
and
1 deletion
+55
-1
get_project_config_server.js
qa_shell_script/config_server/get_project_config_server.js
+55
-1
No files found.
qa_shell_script/config_server/get_project_config_server.js
View file @
01510169
...
@@ -147,7 +147,17 @@ function getProjectConfigPromise() {
...
@@ -147,7 +147,17 @@ function getProjectConfigPromise() {
});
});
})
})
}
}
function
getProjectConfigPromiseByDb
()
{
return
new
Promise
(
function
(
resolve
,
reject
)
{
// mongoose.model("ProConfig",new mongoose.Schema({}))
ProConfig
.
find
({}).
exec
().
then
(
res
=>
{
// let _pros = JSON.parse(JSON.stringify(res));
resolve
(
res
)
}).
catch
((
err
)
=>
{
reject
(
err
)
});
})
}
// let db_conf = db_config.db_config();
// let db_conf = db_config.db_config();
// let db_conf_keys = Object.keys(db_conf);
// let db_conf_keys = Object.keys(db_conf);
// 从mongo中获取DB配置
// 从mongo中获取DB配置
...
@@ -348,6 +358,50 @@ admin.get('/get_namespace_by_type_for_jenkins/:_type', async function (req, res)
...
@@ -348,6 +358,50 @@ 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
"
));
});
});
// 给jenkins使用获取服务groupname_projectname
admin
.
get
(
'
/get_groupname_by_type_for_jenkins/:_type
'
,
async
function
(
req
,
res
)
{
let
configs
=
await
getProjectConfigPromiseByDb
();
let
re
=
{
ui
:[],
java
:[],
node
:[],
python
:[]
};
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
==
"
paycenter-ui
"
){
payui
[
0
][
0
]
=
o
.
git_path_group
payui
[
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
==
"
new-paycenter-ui
"
){
payui
[
0
][
1
]
=
o
.
git_path_group
payui
[
1
][
1
]
=
o
.
project_name
}
else
{
if
(
req
.
params
.
_type
!=
"
lua_ui
"
){
if
(
re
[
req
.
params
.
_type
]
==
undefined
){
re
[
req
.
params
.
_type
]
=
[];
}
re
[
o
.
type
].
push
(
`
${
o
.
git_path_group
}
/
${
o
.
project_name
}
`
)
}
}
}
function
getLuaUiStr
(
item
){
return
`
${
item
[
0
][
0
]}
--
${
item
[
0
][
1
]}
/
${
item
[
1
][
0
]}
--
${
item
[
1
][
1
]}
`
}
let
lua_ui
=
[],
cb
=
""
;
if
(
req
.
params
.
_type
==
"
lua_ui
"
){
lua_ui
.
push
(
getLuaUiStr
(
xjdui
));
lua_ui
.
push
(
getLuaUiStr
(
payui
));
cb
=
lua_ui
.
join
(
"
\n
"
);
}
else
{
res
.
send
(
re
[
req
.
params
.
_type
].
join
(
"
\n
"
));
}
});
// 增加一个新的nginx映射
// 增加一个新的nginx映射
admin
.
post
(
'
/add_new_proxy
'
,
function
(
req
,
res
)
{
admin
.
post
(
'
/add_new_proxy
'
,
function
(
req
,
res
)
{
...
...
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