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
fea59212
Commit
fea59212
authored
Feb 11, 2018
by
tywldx
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://git.quantgroup.cn/QA/qa-deploy-utils
parents
339511f2
6166a2c4
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
23 additions
and
10 deletions
+23
-10
db_config
db-utils/config/db_config
+1
-2
daily_db_backup.sh
db-utils/daily_db_backup.sh
+2
-2
db_gen_config.sh
db-utils/db_gen_config.sh
+2
-2
db_schema_sync.sh
db-utils/db_schema_sync.sh
+3
-3
db.js
qa_shell_script/config_server/config/db.js
+15
-1
No files found.
db-utils/config/db_config
View file @
fea59212
database_list=mall xyqb account_center cash_loan_flow clotho contract display dujiangyan financial_system financial_system_api fund_manage gyxd mall_settlement merchant notify offline payment_center qinqiong quartz reconciliation redpacket risk_control score silk_road spider_center traffic_distribution urge_dispatcher user_credit xyqb_app xyqb_btzt xyqb_user
database_list=mall xyqb account_center cash_loan_flow clotho contract display dujiangyan financial_system financial_system_api fund_manage gyxd mall_settlement merchant notify offline payment_center qinqiong quartz reconciliation redpacket risk_control score silk_road spider_center traffic_distribution urge_dispatcher user_credit xyqb_app xyqb_btzt xyqb_user
source_db_pwd=Uiwb@o^fR&nHOa5t
\ No newline at end of file
\ No newline at end of file
db-utils/daily_db_backup.sh
View file @
fea59212
...
@@ -6,8 +6,8 @@ sync_config_folder=/home/db_sync_configs
...
@@ -6,8 +6,8 @@ sync_config_folder=/home/db_sync_configs
db_backup_folder
=
/home/daily_db_backup
db_backup_folder
=
/home/daily_db_backup
source_db_host
=
$1
source_db_host
=
$1
source_db_user
=
$2
source_db_user
=
`
curl
-s
http://192.168.4.3:10088/config_server/get_db_config/xyqb/user
`
source_db_pwd
=
`
grep
source_db_pwd
$work_dir
/config/db_config |
cut
-d
"="
-f
2
`
source_db_pwd
=
`
curl
-s
http://192.168.4.3:10088/config_server/get_db_config/xyqb/pwd
`
target_db_host
=
192.168.6.2
target_db_host
=
192.168.6.2
target_db_port
=
3306
target_db_port
=
3306
...
...
db-utils/db_gen_config.sh
View file @
fea59212
...
@@ -10,8 +10,6 @@ source ~/.bash_profile
...
@@ -10,8 +10,6 @@ source ~/.bash_profile
work_dir
=
/home/qa-deploy-utils/db-utils
work_dir
=
/home/qa-deploy-utils/db-utils
source_db_host
=
$1
source_db_host
=
$1
source_db_user
=
`
curl
-s
http://192.168.4.3:10088/config_server/get_db_config/cash_loan_flow/user
`
source_db_pwd
=
`
curl
-s
http://192.168.4.3:10088/config_server/get_db_config/cash_loan_flow/pwd
`
# source_db_pwd=`grep source_db_pwd $work_dir/config/db_config | cut -d "=" -f 2`
# source_db_pwd=`grep source_db_pwd $work_dir/config/db_config | cut -d "=" -f 2`
target_db_host
=
$4
target_db_host
=
$4
...
@@ -20,6 +18,8 @@ target_db_pwd=$6
...
@@ -20,6 +18,8 @@ target_db_pwd=$6
sync_db_name
=
$7
sync_db_name
=
$7
database_name
=
$sync_db_name
database_name
=
$sync_db_name
source_db_user
=
`
curl
-s
http://192.168.4.3:10088/config_server/get_db_config/
$database_name
/user
`
source_db_pwd
=
`
curl
-s
http://192.168.4.3:10088/config_server/get_db_config/
$database_name
/pwd
`
config_file_name
=
$8
config_file_name
=
$8
db_backup_sub_folders
=
$9
db_backup_sub_folders
=
$9
...
...
db-utils/db_schema_sync.sh
View file @
fea59212
...
@@ -30,8 +30,8 @@ sync_config_folder=/home/db_sync_configs
...
@@ -30,8 +30,8 @@ sync_config_folder=/home/db_sync_configs
db_backup_folder
=
/home/db_backups
db_backup_folder
=
/home/db_backups
source_db_host
=
$1
source_db_host
=
$1
source_db_user
=
$2
source_db_user
=
`
curl
-s
http://192.168.4.3:10088/config_server/get_db_config/xyqb/user
`
source_db_pwd
=
`
grep
source_db_pwd
$work_dir
/config/db_config |
cut
-d
"="
-f
2
`
source_db_pwd
=
`
curl
-s
http://192.168.4.3:10088/config_server/get_db_config/xyqb/pwd
`
ip_value
=
$4
ip_value
=
$4
...
@@ -119,7 +119,7 @@ function run_sql_file()
...
@@ -119,7 +119,7 @@ function run_sql_file()
}
}
# database_list=`grep database_list $work_dir/config/db_config | cut -d "=" -f 2`
# database_list=`grep database_list $work_dir/config/db_config | cut -d "=" -f 2`
database_list
=
`
curl http://192.168.4.3:10088/config_server/get_db_config/all/name
`
database_list
=
`
curl
-s
http://192.168.4.3:10088/config_server/get_db_config/all/name
`
if
[[
"
$sync_db_name
"
=
"all"
]]
;
then
if
[[
"
$sync_db_name
"
=
"all"
]]
;
then
echo
"sync all database schema"
echo
"sync all database schema"
...
...
qa_shell_script/config_server/config/db.js
View file @
fea59212
...
@@ -8,20 +8,34 @@ var db = function( host, port, user, pwd, sys_table_list){
...
@@ -8,20 +8,34 @@ var db = function( host, port, user, pwd, sys_table_list){
module
.
exports
=
{
module
.
exports
=
{
db_config
:
function
(){
db_config
:
function
(){
this
.
dbs
=
{
this
.
dbs
=
{
mall
:
new
db
(
''
,
''
,
''
,
''
,
'
activity_3c_product ad_detail admin_banner advertisement_type album app_channel app_channel_ad app_name app_name_ad category category_banner category_nature commodity_slogan commodity_slogan_product configuration edx_city faster_entrance faster_entrance_image goods_after_sale_config goods_after_sale_step home_config home_page hot_category jd_address jd_after_sale_config jd_brand jd_category jd_product_sku_image jd_property jd_sku jd_sku_detail_image jd_sku_specs life_faster_entrance life_service mall_category mall_config merchant nature_value new_3c_product product product_category product_nature product_nature_value_bak product_sku product_sku_image product_specification product_spu recommend_brand recommend_product sale_product_detail sale_product_theme spu_image supplier tab_navigate title_banner loan_config virtual_brand virtual_category virtual_product_discount virtual_product_hot virtual_product_sku virtual_product_spu virtual_product_template
'
),
mall
:
new
db
(
'
192.168.3.19
'
,
''
,
''
,
''
,
'
activity_3c_product ad_detail admin_banner advertisement_type album app_channel app_channel_ad app_name app_name_ad category category_banner category_nature commodity_slogan commodity_slogan_product configuration edx_city faster_entrance faster_entrance_image goods_after_sale_config goods_after_sale_step home_config home_page hot_category jd_address jd_after_sale_config jd_brand jd_category jd_product_sku_image jd_property jd_sku jd_sku_detail_image jd_sku_specs life_faster_entrance life_service mall_category mall_config merchant nature_value new_3c_product product product_category product_nature product_nature_value_bak product_sku product_sku_image product_specification product_spu recommend_brand recommend_product sale_product_detail sale_product_theme spu_image supplier tab_navigate title_banner loan_config virtual_brand virtual_category virtual_product_discount virtual_product_hot virtual_product_sku virtual_product_spu virtual_product_template
'
),
xyqb
:
new
db
(
''
,
''
,
''
,
''
,
'
baitiao_merchant baitiao_secure_key channel funding_contract funding_corp loan_product merchant_channel payeco_return_url_info red_packet t_phonenum zmxy_return_url configuration secure_proxy funding_corp_config funding_info_map baitiao_preferential_rule funding_corp_policy
'
),
xyqb
:
new
db
(
''
,
''
,
''
,
''
,
'
baitiao_merchant baitiao_secure_key channel funding_contract funding_corp loan_product merchant_channel payeco_return_url_info red_packet t_phonenum zmxy_return_url configuration secure_proxy funding_corp_config funding_info_map baitiao_preferential_rule funding_corp_policy
'
),
account_center
:
new
db
(
'
192.168.4.116
'
,
'
6001
'
,
''
,
''
,
''
),
account_center
:
new
db
(
'
192.168.4.116
'
,
'
6001
'
,
''
,
''
,
''
),
cash_loan_flow
:
new
db
(
'
192.168.4.80
'
,
'
8001
'
,
''
,
''
,
'
order_callback callback_configuration channel_configuration filter_configuration
'
),
cash_loan_flow
:
new
db
(
'
192.168.4.80
'
,
'
8001
'
,
''
,
''
,
'
order_callback callback_configuration channel_configuration filter_configuration
'
),
clotho
:
new
db
(
'
192.168.3.19
'
,
'
3308
'
,
''
,
''
,
''
),
clotho
:
new
db
(
'
192.168.3.19
'
,
'
3308
'
,
''
,
''
,
''
),
contract
:
new
db
(
''
,
'
3311
'
,
''
,
''
,
'
contract_template_new
'
),
contract
:
new
db
(
''
,
'
3311
'
,
''
,
''
,
'
contract_template_new
'
),
display
:
new
db
(
'
192.168.3.19
'
,
'
3307
'
,
''
,
''
,
'
discovery_config
'
),
display
:
new
db
(
'
192.168.3.19
'
,
'
3307
'
,
''
,
''
,
'
discovery_config
'
),
dujiangyan
:
new
db
(
''
,
'
3310
'
,
''
,
''
,
'
external_coopr
'
),
dujiangyan
:
new
db
(
''
,
'
3310
'
,
''
,
''
,
'
external_coopr
'
),
financial_system
:
new
db
(
''
,
'
6603
'
,
''
,
''
,
'
collection_user sys_dictionary sys_status_edge sys_status_vertice
'
),
financial_system
:
new
db
(
''
,
'
6603
'
,
''
,
''
,
'
collection_user sys_dictionary sys_status_edge sys_status_vertice
'
),
financial_system_api
:
new
db
(
''
,
'
6603
'
,
''
,
''
,
'
mailinfo
'
),
financial_system_api
:
new
db
(
''
,
'
6603
'
,
''
,
''
,
'
mailinfo
'
),
fund_manage
:
new
db
(
''
,
'
3310
'
,
''
,
''
,
'
business_info email_info fund_info merchant
'
),
fund_manage
:
new
db
(
''
,
'
3310
'
,
''
,
''
,
'
business_info email_info fund_info merchant
'
),
gyxd
:
new
db
(
'
192.168.4.116
'
,
'
6602
'
,
''
,
''
,
'
administrative_districts templet user
'
),
gyxd
:
new
db
(
'
192.168.4.116
'
,
'
6602
'
,
''
,
''
,
'
administrative_districts templet user
'
),
mall_settlement
:
new
db
(
'
192.168.4.253
'
,
'
3315
'
,
''
,
''
,
'
role role_user user
'
),
mall_settlement
:
new
db
(
'
192.168.4.253
'
,
'
3315
'
,
''
,
''
,
'
role role_user user
'
),
merchant
:
new
db
(
''
,
'
3314
'
,
''
,
''
,
'
authority product_nature role role_authority role_supplier role_user user
'
),
merchant
:
new
db
(
''
,
'
3314
'
,
''
,
''
,
'
authority product_nature role role_authority role_supplier role_user user
'
),
notify
:
new
db
(
'
192.168.4.6
'
,
'
7306
'
,
''
,
''
,
'
merchant merchant_config
'
),
notify
:
new
db
(
'
192.168.4.6
'
,
'
7306
'
,
''
,
''
,
'
merchant merchant_config
'
),
offline
:
new
db
(
''
,
'
3311
'
,
''
,
''
,
'
goods_detail merchant operator_user
'
),
offline
:
new
db
(
''
,
'
3311
'
,
''
,
''
,
'
goods_detail merchant operator_user
'
),
...
...
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