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
7d6adb02
Commit
7d6adb02
authored
Nov 22, 2017
by
tywldx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
64d1cfbe
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
11 deletions
+20
-11
get_project_config_server.js
qa_shell_script/config_server/get_project_config_server.js
+20
-11
No files found.
qa_shell_script/config_server/get_project_config_server.js
View file @
7d6adb02
...
@@ -16,13 +16,10 @@ app.use(bodyParser.json())
...
@@ -16,13 +16,10 @@ app.use(bodyParser.json())
admin
.
get
(
'
/get_node_command/:name
'
,
function
(
req
,
res
)
{
admin
.
get
(
'
/get_node_command/:name
'
,
function
(
req
,
res
)
{
console
.
log
(
req
.
params
.
name
)
res
.
setHeader
(
"
Content-Type
"
,
"
application/json
"
);
res
.
setHeader
(
"
Content-Type
"
,
"
application/json
"
);
var
str
=
execSync
(
`node ./get_project_config.js -name
${
req
.
params
.
name
}
-attr config_file/command/gitPathHead`
)
var
str
=
execSync
(
`node ./get_project_config.js -name
${
req
.
params
.
name
}
-attr config_file/command/gitPathHead`
)
var
items
=
String
(
str
).
replace
(
/
\n
/g
,
""
).
split
(
"
|
"
);
var
items
=
String
(
str
).
replace
(
/
\n
/g
,
""
).
split
(
"
|
"
);
var
config_file
=
items
[
0
].
replace
(
/
\^
/g
,
"
"
);
var
config_file
=
items
[
0
].
replace
(
/
\^
/g
,
"
"
);
console
.
log
(
items
)
console
.
log
(
items
);
var
command
=
items
[
1
].
replace
(
/
\^
/g
,
"
"
);
var
command
=
items
[
1
].
replace
(
/
\^
/g
,
"
"
);
var
gitGroup
=
items
[
2
].
replace
(
/
\^
/g
,
"
"
);
var
gitGroup
=
items
[
2
].
replace
(
/
\^
/g
,
"
"
);
res
.
send
({
configPath
:
config_file
,
buildCmd
:
command
,
gitGroup
:
gitGroup
});
res
.
send
({
configPath
:
config_file
,
buildCmd
:
command
,
gitGroup
:
gitGroup
});
...
@@ -30,7 +27,6 @@ admin.get('/get_node_command/:name', function (req, res) {
...
@@ -30,7 +27,6 @@ admin.get('/get_node_command/:name', function (req, res) {
admin
.
post
(
'
/add_new_proxy
'
,
function
(
req
,
res
)
{
admin
.
post
(
'
/add_new_proxy
'
,
function
(
req
,
res
)
{
let
request
=
req
.
body
;
let
request
=
req
.
body
;
console
.
log
(
request
)
var
str
=
String
(
execSync
(
`cat ../ngrok/docker_env_name.sh`
)).
replace
(
/
\n
/
,
""
);
var
str
=
String
(
execSync
(
`cat ../ngrok/docker_env_name.sh`
)).
replace
(
/
\n
/
,
""
);
var
index
=
str
.
indexOf
(
request
[
"
namespace
"
])
var
index
=
str
.
indexOf
(
request
[
"
namespace
"
])
let
newstr
=
""
,
sourcestr
;
let
newstr
=
""
,
sourcestr
;
...
@@ -38,11 +34,7 @@ admin.post('/add_new_proxy', function (req, res) {
...
@@ -38,11 +34,7 @@ admin.post('/add_new_proxy', function (req, res) {
//存在这个配置,判断是否是原有的IP
//存在这个配置,判断是否是原有的IP
var
reg
=
new
RegExp
(
request
[
"
namespace
"
]
+
"
\\
|
\\
d*
\\
.
\\
d*
\\
.
\\
d*
\\
.
\\
d*
"
);
var
reg
=
new
RegExp
(
request
[
"
namespace
"
]
+
"
\\
|
\\
d*
\\
.
\\
d*
\\
.
\\
d*
\\
.
\\
d*
"
);
try
{
try
{
console
.
log
(
str
)
console
.
log
(
reg
)
sourcestr
=
str
.
match
(
reg
);
sourcestr
=
str
.
match
(
reg
);
console
.
log
(
sourcestr
)
sourcestr
=
sourcestr
[
0
]
sourcestr
=
sourcestr
[
0
]
}
catch
(
e
){
}
catch
(
e
){
res
.
send
({
msg
:
"
错误,请检查 docket_env_name.sh 文件
"
})
res
.
send
({
msg
:
"
错误,请检查 docket_env_name.sh 文件
"
})
...
@@ -66,13 +58,30 @@ admin.post('/add_new_proxy', function (req, res) {
...
@@ -66,13 +58,30 @@ admin.post('/add_new_proxy', function (req, res) {
//文件添加到这里面
//文件添加到这里面
}
}
newstr
=
newstr
.
replace
(
/
\n
/
,
""
);
newstr
=
newstr
.
replace
(
/
\n
/
,
""
);
console
.
log
(
newstr
)
console
.
log
(
"
------------------------
"
)
execSync
(
`echo "
${
newstr
}
" > ../ngrok/docker_env_name.sh`
)
execSync
(
`echo "
${
newstr
}
" > ../ngrok/docker_env_name.sh`
)
execSyn
c
(
"
../ngrok/make_frp_ini.sh
"
);
cproc
.
exe
c
(
"
../ngrok/make_frp_ini.sh
"
);
res
.
send
({
msg
:
"
执行完成
"
});
res
.
send
({
msg
:
"
执行完成
"
});
});
});
admin
.
get
(
'
/remove_proxy
'
,
function
(
req
,
res
)
{
var
str
=
String
(
execSync
(
`cat ../ngrok/docker_env_name.sh`
)).
replace
(
/
\n
/
,
""
);
var
sourcestr
;
var
reg
=
new
RegExp
(
request
[
"
namespace
"
]
+
"
\\
|
\\
d*
\\
.
\\
d*
\\
.
\\
d*
\\
.
\\
d*
"
);
try
{
sourcestr
=
str
.
replace
(
reg
,
""
);
}
catch
(
e
){
res
.
send
({
msg
:
"
错误,请检查 docket_env_name.sh 文件
"
})
return
}
execSync
(
`echo "
${
sourcestr
}
" > ../ngrok/docker_env_name.sh`
);
cproc
.
exec
(
"
../ngrok/make_frp_ini.sh
"
);
res
.
setHeader
(
"
Content-Type
"
,
"
application/json
"
);
var
str
=
execSync
(
`cat ../ngrok/docker_env_name.sh`
)
res
.
send
({
namespace
:
String
(
str
)});
});
admin
.
get
(
'
/get_proxy
'
,
function
(
req
,
res
)
{
admin
.
get
(
'
/get_proxy
'
,
function
(
req
,
res
)
{
res
.
setHeader
(
"
Content-Type
"
,
"
application/json
"
);
res
.
setHeader
(
"
Content-Type
"
,
"
application/json
"
);
var
str
=
execSync
(
`cat ../ngrok/docker_env_name.sh`
)
var
str
=
execSync
(
`cat ../ngrok/docker_env_name.sh`
)
...
...
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