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
1d270ca6
Commit
1d270ca6
authored
Dec 06, 2017
by
智勇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
1d76b059
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
31 deletions
+25
-31
db_replace_ip.sh
db-utils/db_replace_ip.sh
+24
-30
db_schema_sync.sh
db-utils/db_schema_sync.sh
+1
-1
No files found.
db-utils/db_replace_ip.sh
View file @
1d270ca6
...
@@ -17,12 +17,9 @@ config_server="$pwd_path/config_server"
...
@@ -17,12 +17,9 @@ config_server="$pwd_path/config_server"
project_path
=
`
cat
$config_server
/project_path.sh
`
project_path
=
`
cat
$config_server
/project_path.sh
`
config_path
=
`
cat
$config_server
/config_path.sh
`
config_path
=
`
cat
$config_server
/config_path.sh
`
echo
$server_host
echo
$server_host
cd
$db_sub_backup_folder
cd
$db_sub_backup_folder
file_count
=
`
ls
-l
|grep
"^-"
|wc
-l
`
hosts
=
`
node
$config_server
/get_project_config.js
-type
multi
-attr
port/url
-attr2
true
`
hosts
=
`
node
$config_server
/get_project_config.js
-type
multi
-attr
port/url
-attr2
true
`
function
transByPort
()
function
transByPort
()
...
@@ -75,33 +72,30 @@ if [ $database_name = 'mall' ];then
...
@@ -75,33 +72,30 @@ if [ $database_name = 'mall' ];then
fi
fi
done
done
else
else
echo
"./* file count is
$file_count
"
sed
-i
"s/https
\:
/http
\:
/g"
$db_sub_backup_folder
/
*
if
[
"
$file_count
"
-gt
0
]
;
then
if
[
"
$re_replace_ip
"
=
true
]
;
then
sed
-i
"s/https
\:
/http
\:
/g"
*
echo
"replace public ip for
$db_sub_backup_folder
/*"
if
[
"
$re_replace_ip
"
=
true
]
;
then
for
host
in
$hosts
echo
"replace public ip for
$db_sub_backup_folder
/*"
do
for
host
in
$hosts
arr
=
${
host
//|/
}
do
transByPort
$arr
"
$db_sub_backup_folder
/*"
arr
=
${
host
//|/
}
done
transByPort
$arr
"
$db_sub_backup_folder
/*"
elif
[
"
$re_replace_ip
"
=
false
]
;
then
done
echo
"replace ip for
$db_sub_backup_folder
/*"
elif
[
"
$re_replace_ip
"
=
false
]
;
then
for
host
in
$hosts
echo
"replace ip for
$db_sub_backup_folder
/*"
do
for
host
in
$hosts
arr
=
${
host
//|/
}
do
transByUrl
$arr
"
$db_sub_backup_folder
/*"
arr
=
${
host
//|/
}
done
transByUrl
$arr
"
$db_sub_backup_folder
/*"
else
done
echo
"replace
$re_replace_ip
ip for
$db_sub_backup_folder
/*"
else
echo
"sed -i "
s#
\.
xyqb
\.
com#-
${
re_replace_ip
}
.q-gp.com#g
"
$db_sub_backup_folder
/*"
echo
"replace
$re_replace_ip
ip for
$db_sub_backup_folder
/*"
sed
-i
"s#
\.
xyqb
\.
com#-
${
re_replace_ip
}
.q-gp.com#g"
$db_sub_backup_folder
/
*
echo
"sed -i "
s#
\.
xyqb
\.
com#-
${
re_replace_ip
}
.q-gp.com#g
"
$db_sub_backup_folder
/*"
#for host in $hosts
sed
-i
"s#
\.
xyqb
\.
com#-
${
re_replace_ip
}
.q-gp.com#g"
$db_sub_backup_folder
/
*
#do
#for host in $hosts
# arr=${host//|/ }
#do
# transByPara $arr $entry $re_replace_ip
# arr=${host//|/ }
#done
# transByPara $arr $entry $re_replace_ip
#done
fi
fi
fi
fi
fi
...
...
db-utils/db_schema_sync.sh
View file @
1d270ca6
...
@@ -93,7 +93,7 @@ function db_schema_sync()
...
@@ -93,7 +93,7 @@ function db_schema_sync()
cd
$db_backup_sub_folders
cd
$db_backup_sub_folders
file_count
=
`
ls
-l
|
grep
.sql
$
|
wc
-l
`
file_count
=
`
ls
-l
|
grep
.sql
$
|
wc
-l
`
echo
"
.
/*.sql file count is
$file_count
"
echo
"
$db_backup_sub_folders
/*.sql file count is
$file_count
"
if
[
"
$file_count
"
-gt
0
]
;
then
if
[
"
$file_count
"
-gt
0
]
;
then
echo
"--- Step 2: replace domain name in tables:
$database
$db_backup_sub_folders
---"
echo
"--- Step 2: replace domain name in tables:
$database
$db_backup_sub_folders
---"
echo
"--- Step 2: is re_replace_ip:
$re_replace_ip
---"
echo
"--- Step 2: is re_replace_ip:
$re_replace_ip
---"
...
...
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