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
abf0150d
Commit
abf0150d
authored
Mar 27, 2017
by
root
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add new shell
parent
fc217d29
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
148 additions
and
26 deletions
+148
-26
2_get_code_by_name.sh
qa_shell_script/2_get_code_by_name.sh
+0
-4
5_restart_by_type.sh
qa_shell_script/5_restart_by_type.sh
+1
-1
get_env_ip.sh
qa_shell_script/config_server/get_env_ip.sh
+1
-1
get_project_config.js
qa_shell_script/config_server/get_project_config.js
+7
-4
exception_sub_shell.sh
qa_shell_script/exception_sub_shell.sh
+8
-4
db_tran.sh
qa_shell_script/initial_env/db_tran.sh
+8
-0
remote_initial_env.sh
qa_shell_script/initial_env/remote_initial_env.sh
+50
-0
remove_logs.sh
qa_shell_script/log_shell/remove_logs.sh
+26
-1
mock_funding_corp.sh
qa_shell_script/mock_funding_corp.sh
+23
-0
public_tran.sh
qa_shell_script/mysql/public_tran.sh
+11
-0
make_ngrok_yml.sh
qa_shell_script/ngrok/make_ngrok_yml.sh
+1
-1
sub_shell.sh
qa_shell_script/sub_shell.sh
+12
-10
No files found.
qa_shell_script/2_get_code_by_name.sh
View file @
abf0150d
...
...
@@ -28,11 +28,7 @@ if [ -n "$project_folder" ];then
git pull
else
echo
"Fail to checkout branch
$git_branch
"
.
<<<<<<
< HEAD
exit
-1
=======
exit
-1
>>>>>>>
4e22e35ad767ef00b82ce39c3a2940fa60e90072
fi
else
echo
"checkout default branch master"
...
...
qa_shell_script/5_restart_by_type.sh
View file @
abf0150d
...
...
@@ -172,8 +172,8 @@ elif [ "$project_type" = "python" ]; then
elif
[
"
$project_type
"
=
"ui"
]
;
then
restartUiProject
else
restartJavaProject
restartNodeProject
restartPythonProject
restartUiProject
restartJavaProject
fi
qa_shell_script/config_server/get_env_ip.sh
View file @
abf0150d
12 13 14 15 16 17 22 23 24 50 151 152
12 13 14 15 16 17 22 23 24 50 151 152
154 156
qa_shell_script/config_server/get_project_config.js
View file @
abf0150d
...
...
@@ -68,13 +68,16 @@ new pClass().init(true, "java", "7023", "xyqb-quartz", false, "QG", "quartz.log"
new
pClass
().
init
(
true
,
"
java
"
,
"
7021
"
,
"
spider-center
"
,
false
,
"
QG
"
,
"
spider-center.log
"
,
"
application.properties
"
,
null
,
null
,
2
,
"
授信-server
"
,
""
);
new
pClass
().
init
(
true
,
"
java
"
,
"
7037
"
,
"
cash-loan-flow
"
,
false
,
"
QG
"
,
"
cash_loan_flow.log
"
,
"
application.properties
"
,
null
,
null
,
2
,
"
现金贷流量对接-server
"
,
""
);
new
pClass
().
init
(
true
,
"
java
"
,
"
7012
"
,
"
financial-system
"
,
false
,
"
QG
"
,
"
financial_system.log
"
,
"
application.properties
"
,
null
,
null
,
2
,
"
财务系统-server
"
,
""
);
new
pClass
().
init
(
tru
e
,
"
java
"
,
"
7034
"
,
"
fund-manage
"
,
false
,
"
QG
"
,
"
fund_manage.log
"
,
"
application.properties
"
,
null
,
null
,
2
,
"
债转系统-server
"
,
""
);
new
pClass
().
init
(
tru
e
,
"
java
"
,
"
7029
"
,
"
gyxd
"
,
false
,
"
QG
"
,
"
gyxd.log
"
,
"
application.properties
"
,
null
,
null
,
2
,
"
广源小贷-server
"
,
""
);
new
pClass
().
init
(
fals
e
,
"
java
"
,
"
7034
"
,
"
fund-manage
"
,
false
,
"
QG
"
,
"
fund_manage.log
"
,
"
application.properties
"
,
null
,
null
,
2
,
"
债转系统-server
"
,
""
);
new
pClass
().
init
(
fals
e
,
"
java
"
,
"
7029
"
,
"
gyxd
"
,
false
,
"
QG
"
,
"
gyxd.log
"
,
"
application.properties
"
,
null
,
null
,
2
,
"
广源小贷-server
"
,
""
);
new
pClass
().
init
(
true
,
"
java
"
,
"
7038
"
,
"
merchant-backend
"
,
false
,
"
QG
"
,
"
merchant.log
"
,
"
application.properties
"
,
null
,
null
,
2
,
"
商户后台-server
"
,
"
凌子华/陈东亮
"
);
new
pClass
().
init
(
true
,
"
java
"
,
"
7031
"
,
"
redpacket
"
,
false
,
"
QG
"
,
"
redpacket.log
"
,
"
application.properties
"
,
null
,
null
,
2
,
"
红包系统-server
"
,
""
);
new
pClass
().
init
(
tru
e
,
"
java
"
,
"
7044
"
,
"
finance-api
"
,
false
,
"
bo.wang
"
,
"
finance-api.log
"
,
"
application.properties
"
,
null
,
null
,
2
,
"
财务系统-server
"
,
""
);
new
pClass
().
init
(
tru
e
,
"
java
"
,
"
7045
"
,
"
check-accounts
"
,
false
,
"
QG
"
,
"
check_accounts.log
"
,
"
application.properties
"
,
null
,
null
,
2
,
"
对账系统-server
"
,
""
);
new
pClass
().
init
(
fals
e
,
"
java
"
,
"
7044
"
,
"
finance-api
"
,
false
,
"
bo.wang
"
,
"
finance-api.log
"
,
"
application.properties
"
,
null
,
null
,
2
,
"
财务系统-server
"
,
""
);
new
pClass
().
init
(
fals
e
,
"
java
"
,
"
7045
"
,
"
check-accounts
"
,
false
,
"
QG
"
,
"
check_accounts.log
"
,
"
application.properties
"
,
null
,
null
,
2
,
"
对账系统-server
"
,
""
);
new
pClass
().
init
(
true
,
"
java
"
,
"
7014
"
,
"
du-jiang-yan
"
,
false
,
"
QG
"
,
"
du_jiang_yan.log
"
,
"
application.properties
"
,
null
,
null
,
2
,
"
第三方对接导流-server
"
,
""
);
new
pClass
().
init
(
false
,
"
java
"
,
"
7051
"
,
"
msg
"
,
false
,
"
QG
"
,
"
msg.log
"
,
"
application.properties
"
,
null
,
null
,
2
,
"
新版消息中心
"
,
""
);
new
pClass
().
init
(
false
,
"
java
"
,
"
7052
"
,
"
xyqb-btzt
"
,
true
,
"
git@gitabc.xyqb.com:QG/xyqb-btzt.git
"
,
"
xyqb-btzt.log
"
,
"
application.properties
"
,
null
,
null
,
2
,
"
白条直投外部
"
,
""
);
new
pClass
().
init
(
false
,
"
java
"
,
"
7053
"
,
"
xyqb-btzt-internal
"
,
true
,
"
git@gitabc.xyqb.com:qg-op-backend/xyqb-btzt-internal.git
"
,
"
xyqb-btzt-internal.log
"
,
"
application.properties
"
,
null
,
null
,
2
,
"
白条直投内部
"
,
""
);
// new pClass(true,"java","7027","sms-center","QG","sms-center.log",null,null,null,"短信中心-server");
// ui----
// projectName,projectType,port,gitPath,logName,configFile,command,nodeVersion
...
...
qa_shell_script/exception_sub_shell.sh
View file @
abf0150d
...
...
@@ -72,13 +72,17 @@ tranceConfig java "hubei.api.url=http:\/\/192.168.100.185:8585" "hubei.api.url=h
#tranceConfig java "192.168.4.14:3306" "192.168.4.20:3306" "192.168.4.14" "*"
#tranceConfig python "192.168.4.14" "192.168.4.20" "192.168.4.14" "qin-qiong.*"
tranceConfig java
"spider-center.host=http:
\/\/
192.168.4.12:7021
\/
"
"spider-center.host=http:
\/\/
spider-center-12.ss.xyqb.loan
\/
"
"192.168.4.12"
"spider-center.properties"
#
tranceConfig java "spider-center.host=http:\/\/192.168.4.12:7021\/" "spider-center.host=http:\/\/spider-center-12.ss.xyqb.loan\/" "192.168.4.12" "spider-center.properties"
tranceConfig java
"qgbc-ui.url=http:
\/\/
192.168.4.152:7002"
"qgbc-ui.url=http:
\/\/
192.168.4.152:7050"
"192.168.4.152"
"xyqb.properties"
tranceConfig java
"7025"
"7003"
"192.168.4.152"
"baitiao.properties"
tranceConfig node
"112233445512345.ittun.com"
"activity-op-22.ss.xyqb.loan"
"192.168.4.22"
"activity-op.js"
tranceConfig nginx
"7002"
"7050"
"192.168.4.13"
"qgbc-ui.conf"
tranceConfig nginx
"7050"
"7002"
"192.168.4.13"
"bt-ui.conf"
tranceConfig ui
"7002"
"7050"
"192.168.4.13"
"bt-ui.js"
#tranceConfig nginx "7002" "7050" "192.168.4.13" "qgbc-ui.conf"
#tranceConfig nginx "7050" "7002" "192.168.4.13" "bt-ui.conf"
#tranceConfig ui "7002" "7050" "192.168.4.13" "bt-ui.js"
#tranceConfig node "7002" "7050" "192.168.1.23" "AppBackend.js"
tranceConfig java
"7002"
"7050"
"192.168.4.13"
"baitiao.properties"
#tranceConfig node "7002" "7050" "192.168.4.12" "AppBackend.js"
#tranceConfig nginx "7002" "7050" "192.168.4.17" "qgbc-ui.conf"
#tranceConfig nginx "7050" "7002" "192.168.4.17" "bt-ui.conf"
...
...
qa_shell_script/initial_env/db_tran.sh
0 → 100644
View file @
abf0150d
#!/bin/bash
ip
=
`
ifconfig eth0 |
grep
"inet addr"
|
awk
'{ print $2}'
|
awk
-F
:
'{print $2}'
`
cd
/home
rm
-rf
*
.sql
mysqldump
-u
qa
-pqatest
-A
>
all.sql
sed
-i
"s/192.168.4.15/
$ip
/g"
all.sql
mysql
-u
qa
-pqatest
-A
< all.sql
qa_shell_script/initial_env/remote_initial_env.sh
0 → 100644
View file @
abf0150d
#!/bin/bash
ip_last
=
$1
project_type
=
$2
public_ip
=
$3
set timeout
1200
ip
=
192.168.4.
$ip_last
echo
"参数为:
ip :
${
ip
}
project_type :
${
project_type
}
public_ip :
${
public_ip
}
"
sh /home/qa-deploy-utils/qa_shell_script/1_mount_config_files.sh
$ip_last
expect
-c
"
set timeout 10
spawn ssh root@
${
ip
}
expect *ssword* { send !QAZ2wsx
\r
}
expect
\"
]#
\"
send
\"
cd /usr/lib/rabbitmq/bin
\r\"
expect
\"
]#
\"
send
\"
./rabbitmqctl stop
\r\"
sleep 10
expect
\"
]#
\"
send
\"
./rabbitmq-server -detached
\r\"
sleep 10
expect
\"
]#
\"
send
\"
cd /home/qa-deploy-utils/qa_shell_script
\r\"
sleep 10
expect
\"
]#
\"
send
\"
sh rabbitmq/add_mq_user.sh
\r\"
expect
\"
]#
\"
sleep 10
send
\"
sh rabbitmq/initial_mq.sh
\r\"
expect
\"
]#
\"
send
\"
cd /home
\r\"
expect
\"
]#
\"
send
\"
sh /home/qa-deploy-utils/qa_shell_script/initial_env/db_tran.sh
\r\"
expect
\"
]#
\"
send
\"
cd /home/quant_group/mongodb/
\r\"
expect
\"
]#
\"
send
\"
sh start.sh
\r\"
expect
\"
]#
\"
send
\"
cd /home/qa-deploy-utils/qa_shell_script
\r\"
expect
\"
]#
\"
send
\"
sh deploy_project_by_type.sh
$project_type
$branch_name
$public_ip
\r\"
set timeout -1
expect
\"
]#
\"
send
\"
exit
\r\"
expect eof;"
qa_shell_script/log_shell/remove_logs.sh
View file @
abf0150d
#1/bin/bash
#!/bin/bash
year
=
`
date
+%Y
`
month
=
`
date
+%m
`
date
=
`
date
+%d
`
cd
/home/quant_group/logs
rm
-rf
*
.log.
*
rm
-rf
*
-2017
*
.log
for
i
in
`
find
.
-name
"*.log"
`
;
do
cat
/dev/null
>
$i
;
done
cd
/var/log/nginx
rm
-rf
*
.gz
*
.log-
*
for
i
in
`
find
.
-name
"*.log"
`
;
do
cat
/dev/null
>
$i
;
done
cd
/home/quant_group/op-api/logs
rm
-rf
*
.log.
*
for
i
in
`
find
.
-name
"*.log"
`
;
do
cat
/dev/null
>
$i
;
done
cd
/home/quant_group/AppBackend/logs
rm
-rf
`
ls
access
*
.log|grep
-v
$year$month$date
`
rm
-rf
`
ls
*
.log_
*
.log|grep
-v
$year
-
$month
-
$date
`
for
i
in
`
find
.
-name
"*.log"
`
;
do
cat
/dev/null
>
$i
;
done
cd
/home/quant_group/activity-op/logs
rm
-rf
*
.log.
*
for
i
in
`
find
.
-name
"*.log"
`
;
do
cat
/dev/null
>
$i
;
done
cd
/home/quant_group/op-api/logs
rm
-rf
*
.log.
*
for
i
in
`
find
.
-name
"*.log"
`
;
do
cat
/dev/null
>
$i
;
done
qa_shell_script/mock_funding_corp.sh
0 → 100755
View file @
abf0150d
function
mock
()
{
mkdir
-p
/home/quant_group/di-ting/config
if
[[
-a
/home/quant_group/di-ting/config/application.properties
]]
;
then
sed
-i
"/hubei.api.url/d"
/home/quant_group/di-ting/config/application.properties
fi
echo
"hubei.api.url=http://192.168.4.251:8585/Gateway/servlet/OutsiteReqServlet"
>>
/home/quant_group/di-ting/config/application.properties
/home/qa-deploy-utils/qa_shell_script/5_restart_by_name.sh di-ting
}
function
unmock
()
{
if
[[
-a
/home/quant_group/di-ting/config/application.properties
]]
;
then
sed
-i
"/hubei.api.url/d"
/home/quant_group/di-ting/config/application.properties
fi
/home/qa-deploy-utils/qa_shell_script/5_restart_by_name.sh di-ting
}
if
[[
$1
=
"yes"
]]
;
then
mock
else
unmock
fi
qa_shell_script/mysql/public_tran.sh
0 → 100644
View file @
abf0150d
#!/bin/bash
cd
/home
for
port
in
{
1..9
}
do
sed
-i
"s/192.168.4.
${
1
}
:700
$port
/139.198.2.95:
${
1
}
0
$port
/g"
all.sql
done
for
port
in
{
10..50
}
do
sed
-i
"s/192.168.4.
${
1
}
:70
$port
/139.198.2.95:
${
1
}
$port
/g"
all.sql
done
qa_shell_script/ngrok/make_ngrok_yml.sh
View file @
abf0150d
...
...
@@ -57,7 +57,7 @@ do
port
=
`
node
$config_server
/get_project_config.js
-name
$project
-attr
port
`
addFile
$project
$port
$filename
done
projects_of_out_proxy
=(
gu-bei activity-op op-api spider-center
)
projects_of_out_proxy
=(
gu-bei activity-op op-api spider-center
di-ting merchant-backend
)
for
ip_last
in
${
ips
[@]
}
...
...
qa_shell_script/sub_shell.sh
View file @
abf0150d
...
...
@@ -5,12 +5,13 @@ pwd_path="/home/qa-deploy-utils/qa_shell_script"
config_server
=
"
$pwd_path
/config_server"
ips
=
`
cat
$config_server
/get_env_ip.sh
`
mkdir
/home/sub_config_file_dont_rm
mkdir
-p
/home/sub_config_file_dont_rm
for
ip_last_num
in
${
ips
[@]
}
do
echo
"开始生成
${
IP_host_first
}${
ip_last_num
}
"
cd
/home/sub_config_file_dont_rm
mkdir
${
IP_host_first
}${
ip_last_num
}
mkdir
-p
${
IP_host_first
}${
ip_last_num
}
cd
${
IP_host_first
}${
ip_last_num
}
dir
=
`
pwd
`
...
...
@@ -19,9 +20,9 @@ do
mkdir
$dir
/java
rm
-rf
$dir
/public
mkdir
$dir
/public
rm
$dir
/public/java
rm
-rf
$dir
/public/java
mkdir
$dir
/public/java
rm
$dir
/special
rm
-rf
$dir
/special
mkdir
$dir
/special
cp
-rf
/home/config_files/java/
*
$dir
/java/
...
...
@@ -48,14 +49,14 @@ do
#python项目发布
rm
-rf
$dir
/python
mkdir
$dir
/python
mkdir
-p
$dir
/python
cp
-rf
/home/config_files/python/
*
$dir
/python/
sed
-i
"s/target_host_name/
${
IP_host_first
}${
ip_last_num
}
/"
$dir
/python/
*
sed
-i
"s/ip_last/
$ip_last_num
/g"
$dir
/python/
*
#node项目发布
rm
-rf
$dir
/node
mkdir
$dir
/node
mkdir
-p
$dir
/node
cp
-rf
/home/config_files/node/
*
$dir
/node/
sed
-i
"s/target_host_name/
${
IP_host_first
}${
ip_last_num
}
/"
$dir
/node/
*
sed
-i
"s/ip_last/
$ip_last_num
/g"
$dir
/node/
*
...
...
@@ -65,8 +66,8 @@ do
#ui配置发布
rm
-rf
$dir
/ui
mkdir
$dir
/ui
mkdir
$dir
/public
rm
$dir
/public/ui
mkdir
-p
$dir
/public
rm
-rf
$dir
/public/ui
mkdir
$dir
/public/ui
cp
-rf
/home/config_files/ui/
*
$dir
/ui/
cp
-rf
/home/config_files/ui/
*
$dir
/public/ui/
...
...
@@ -74,7 +75,7 @@ do
if
[
$ip_last_num
-lt
100
]
;
then
sed
-i
"s/target_host_name:7/
${
public_ip
}
:
${
ip_last_num
}
/g"
$dir
/public/ui/
*
else
sed
-i
"s/target_host_name:70/
${
public_ip
}
:
${
ip_last_num
}
/g"
$dir
/public/ui/
*
sed
-i
"s/target_host_name:70/
${
public_ip
}
:
${
ip_last_num
}
/g"
$dir
/public/ui/
*
fi
sed
-i
"s/target_host_name/
${
public_ip
}
/g"
$dir
/public/ui/
*
sed
-i
"s/
${
public_ip
}
:3306/
${
IP_host_first
}${
ip_last_num
}
:3306/g"
$dir
/public/ui/
*
...
...
@@ -90,7 +91,8 @@ do
mkdir
$dir
/pem_file
cp
-rf
/home/config_files/pem_file/
*
$dir
/pem_file/
# sed -i "s/target_host_name/${IP_host_first}${ip_last_num}/" $dir/nginx_conf.d/*
echo
"结束
${
IP_host_first
}${
ip_last_num
}
"
echo
"---------"
done
...
...
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