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
45b115e9
Commit
45b115e9
authored
Dec 06, 2017
by
智勇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
1d270ca6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
8 deletions
+7
-8
db_import.sh
db-utils/db_import.sh
+0
-2
db_replace_ip.sh
db-utils/db_replace_ip.sh
+7
-6
No files found.
db-utils/db_import.sh
View file @
45b115e9
...
@@ -23,8 +23,6 @@ fi
...
@@ -23,8 +23,6 @@ fi
echo
"CREATE DATABASE IF NOT EXISTS
\`
${
database_name
}
\`
DEFAULT CHARSET utf8 COLLATE utf8_general_ci;"
echo
"CREATE DATABASE IF NOT EXISTS
\`
${
database_name
}
\`
DEFAULT CHARSET utf8 COLLATE utf8_general_ci;"
echo
"CREATE DATABASE IF NOT EXISTS
\`
${
database_name
}
\`
DEFAULT CHARSET utf8 COLLATE utf8_general_ci;"
| mysql
-h
$mysql_host
-uqa
-pqatest
echo
"CREATE DATABASE IF NOT EXISTS
\`
${
database_name
}
\`
DEFAULT CHARSET utf8 COLLATE utf8_general_ci;"
| mysql
-h
$mysql_host
-uqa
-pqatest
echo
`
pwd
`
for
entry
in
./
*
.sql
for
entry
in
./
*
.sql
do
do
echo
"mysql -h
$mysql_host
-uqa -pqatest
$database_name
<
$entry
"
echo
"mysql -h
$mysql_host
-uqa -pqatest
$database_name
<
$entry
"
...
...
db-utils/db_replace_ip.sh
View file @
45b115e9
...
@@ -18,6 +18,7 @@ project_path=`cat $config_server/project_path.sh`
...
@@ -18,6 +18,7 @@ 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
echo cd
$db_sub_backup_folder
cd
$db_sub_backup_folder
cd
$db_sub_backup_folder
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
`
...
@@ -73,19 +74,19 @@ if [ $database_name = 'mall' ];then
...
@@ -73,19 +74,19 @@ if [ $database_name = 'mall' ];then
done
done
else
else
sed
-i
"s/https
\:
/http
\:
/g"
$db_sub_backup_folder
/
*
sed
-i
"s/https
\:
/http
\:
/g"
$db_sub_backup_folder
/
*
if
[
"
$re_replace_ip
"
=
true
]
;
then
if
[
"
$re_replace_ip
"
=
false
]
;
then
echo
"replace
public
ip for
$db_sub_backup_folder
/*"
echo
"replace ip for
$db_sub_backup_folder
/*"
for
host
in
$hosts
for
host
in
$hosts
do
do
arr
=
${
host
//|/
}
arr
=
${
host
//|/
}
transBy
Port
$arr
"
$db_sub_backup_folder
/*"
transBy
Url
$arr
"
$db_sub_backup_folder
/*"
done
done
elif
[
"
$re_replace_ip
"
=
false
]
;
then
elif
[
"
$re_replace_ip
"
=
true
]
;
then
echo
"replace ip for
$db_sub_backup_folder
/*"
echo
"replace
public
ip for
$db_sub_backup_folder
/*"
for
host
in
$hosts
for
host
in
$hosts
do
do
arr
=
${
host
//|/
}
arr
=
${
host
//|/
}
transBy
Url
$arr
"
$db_sub_backup_folder
/*"
transBy
Port
$arr
"
$db_sub_backup_folder
/*"
done
done
else
else
echo
"replace
$re_replace_ip
ip for
$db_sub_backup_folder
/*"
echo
"replace
$re_replace_ip
ip for
$db_sub_backup_folder
/*"
...
...
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