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
79b1b79a
Commit
79b1b79a
authored
Nov 22, 2017
by
qa_quantgroup
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of git.quantgroup.cn:QA/qa-deploy-utils
parents
b55ff348
7bc70551
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
62 additions
and
23 deletions
+62
-23
get_project_config_server.js
qa_shell_script/config_server/get_project_config_server.js
+50
-11
docker_env_name.sh
qa_shell_script/ngrok/docker_env_name.sh
+1
-0
make_frp_ini.sh
qa_shell_script/ngrok/make_frp_ini.sh
+11
-6
store
qa_shell_script/ngrok/store
+0
-6
No files found.
qa_shell_script/config_server/get_project_config_server.js
View file @
79b1b79a
var
express
=
require
(
'
express
'
);
var
express
=
require
(
'
express
'
);
var
cproc
=
require
(
'
child_process
'
);
var
cproc
=
require
(
'
child_process
'
);
var
bodyParser
=
require
(
'
body-parser
'
);
var
execSync
=
cproc
.
execSync
;
var
execSync
=
cproc
.
execSync
;
var
options
=
{
inflate
:
true
,
limit
:
'
100kb
'
,
type
:
'
application/octet-stream
'
};
var
app
=
express
();
var
app
=
express
();
var
admin
=
express
();
// the sub app
var
admin
=
express
();
// the sub app
app
.
use
(
bodyParser
.
urlencoded
({
extended
:
false
}))
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
)
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
)
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
});
});
});
app
.
use
(
'
/config_server
'
,
admin
);
admin
.
post
(
'
/add_new_proxy
'
,
function
(
req
,
res
)
{
let
request
=
req
.
body
;
var
str
=
String
(
execSync
(
`cat ../ngrok/docker_env_name.sh`
));
var
index
=
str
.
indexOf
(
request
[
"
namespace
"
])
if
(
index
!=
-
1
){
res
.
send
({
msg
:
"
已经存在的配置
"
});
return
}
else
{
let
newstr
=
str
+
"
"
+
request
[
"
namespace
"
]
//文件添加到这里面
execSync
(
`
${
newstr
}
> ../ngrok/docker_env_name.sh}`
)
}
execSync
(
"
../ngrok/make_frp_ini.sh
"
);
res
.
send
({
msg
:
"
执行完成
"
});
});
admin
.
get
(
'
/get_proxy
'
,
function
(
req
,
res
)
{
res
.
setHeader
(
"
Content-Type
"
,
"
application/json
"
);
var
str
=
execSync
(
`cat ../ngrok/docker_env_name.sh`
)
res
.
send
({
namespace
:
String
(
str
)});
});
app
.
use
(
'
/config_server
'
,
admin
)
console
.
log
(
"
http://192.168.4.3:10088/config_server/get_node_command
"
)
console
.
log
(
"
http://192.168.4.3:10088/config_server/get_node_command
"
)
app
.
listen
(
10088
)
app
.
listen
(
10088
)
qa_shell_script/ngrok/docker_env_name.sh
0 → 100644
View file @
79b1b79a
qa0 qa1
\ No newline at end of file
qa_shell_script/ngrok/make_frp_ini.sh
View file @
79b1b79a
...
@@ -2,9 +2,12 @@
...
@@ -2,9 +2,12 @@
pwd_path
=
"/home/qa-deploy-utils/qa_shell_script"
pwd_path
=
"/home/qa-deploy-utils/qa_shell_script"
config_shell_path
=
"
$pwd_path
"
config_shell_path
=
"
$pwd_path
"
config_server
=
"
$pwd_path
/config_server"
config_server
=
"
$pwd_path
/config_server"
filename
=
"/home/quant_group/frp_0.12.0_linux_amd64/frpc_custom_new_1.ini"
frp_file_path
=
"/home/quant_group/frp_0.12.0_linux_amd64"
filename
=
"
$frp_file_path
/frpc_custom_new_1.ini"
nginxname
=
"/usr/local/openresty/nginx/conf/conf.d"
nginxname
=
"/usr/local/openresty/nginx/conf/conf.d"
dockernamespace
=
`
cat
$pwd_path
/ngrok/docker_env_name.sh
`
ips
=
`
cat
$config_server
/get_env_ip.sh
`
ips
=
`
cat
$config_server
/get_env_ip.sh
`
rm
-rf
$filename
rm
-rf
$filename
function
addFrpcHead
()
function
addFrpcHead
()
...
@@ -143,7 +146,8 @@ function createNginxHttpAndSSLConf()
...
@@ -143,7 +146,8 @@ function createNginxHttpAndSSLConf()
}
}
# projectAndPort=`node $config_server/get_project_config.js -type multi -attr port`
rm
-rf
$nginxname
/
*
createNginxSSLConf store 172.30.199.2 9000
$nginxname
/store.conf
createNginxSSLConf store 172.30.199.2 9000
$nginxname
/store.conf
for
ip_last
in
${
ips
[@]
}
for
ip_last
in
${
ips
[@]
}
...
@@ -157,16 +161,17 @@ do
...
@@ -157,16 +161,17 @@ do
done
done
done
done
for
host_name
in
{
0..1
}
for
host_name
in
${
dockernamespace
[@]
}
do
do
projectAndPorts
=
`
node
$config_server
/get_project_config.js
-type
multi
-attr
port/url
-attr2
true
`
projectAndPorts
=
`
node
$config_server
/get_project_config.js
-type
multi
-attr
port/url
-attr2
true
`
for
projectAndPort
in
${
projectAndPorts
[@]
}
for
projectAndPort
in
${
projectAndPorts
[@]
}
do
do
var
=(
${
projectAndPort
//|/
}
)
var
=(
${
projectAndPort
//|/
}
)
addFrpcSub
${
var
[0]
}
-
${
var
[2]
}
http 127.0.0 1 8000
${
var
[2]
}
-
qa
${
host_name
}
$filename
addFrpcSub
${
var
[0]
}
-
${
var
[2]
}
http 127.0.0 1 8000
${
var
[2]
}
-
${
host_name
}
$filename
createNginxHttpAndSSLConf
${
var
[2]
}
-qa
${
host_name
}
192.168.6.6
${
var
[1]
}
$nginxname
/
${
var
[0]
}
-
qa
${
host_name
}
.conf
createNginxHttpAndSSLConf
${
var
[2]
}
-qa
${
host_name
}
192.168.6.6
${
var
[1]
}
$nginxname
/
${
var
[0]
}
-
${
host_name
}
.conf
done
done
done
done
nginx
-s
reload
sh
${
frp_file_path
}
/restart.sh
qa_shell_script/ngrok/store
deleted
100644 → 0
View file @
b55ff348
[store]
type = http
local_port = 127.0.0
custom_domains = 1
locations = 8001
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