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
f0c46e31
Commit
f0c46e31
authored
Jan 18, 2018
by
tywldx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wechart
parent
7d1aef14
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
44 additions
and
9 deletions
+44
-9
6_restart_by_wechat.sh
qa_shell_script/6_restart_by_wechat.sh
+18
-0
restartJava.sh
qa_shell_script/base_script/restartJava.sh
+2
-1
wechat_make.sh
qa_shell_script/special_env_make/wechat_make.sh
+24
-8
No files found.
qa_shell_script/6_restart_by_wechat.sh
0 → 100755
View file @
f0c46e31
#!/bin/bash
project_name
=
$1
wechat_config
=
$2
pwd_path
=
"/home/qa-deploy-utils/qa_shell_script"
config_shell_path
=
"
$pwd_path
"
config_server
=
"
$pwd_path
/config_server"
project_type
=
`
node
$config_server
/get_project_config.js
-name
$project_name
-attr
type
`
project_path
=
`
cat
$config_server
/project_path.sh
`
config_path
=
`
cat
$config_server
/config_path.sh
`
if
[
-z
"
$project_name
"
]
;
then
echo
"清输入项目名称"
exit
-1
fi
if
[
"
$project_type
"
=
"java"
]
;
then
sh
$pwd_path
/base_script/restartJava.sh
$project_name
$config_server
$project_path
" "
$wechat_config
fi
qa_shell_script/base_script/restartJava.sh
View file @
f0c46e31
...
...
@@ -3,6 +3,7 @@ project=$1
config_server
=
$2
project_path
=
$3
ip
=
$4
wechat_config
=
$5
profile
=
test
time
=
`
date
+%Y_%m_%d_%H_%M_%S
`
config_path
=
/home/config_files
...
...
@@ -106,7 +107,7 @@ mv $project_path/logs/$log_name $project_path/logs/$log_name.$time
command1
=
${
run_commands
[0]//\^/
}
command2
=
${
run_commands
[1]//\^/
}
echo
"nohup java
$command1
-jar
${
project
}
.jar
$command2
"
nohup
java
$command1
-jar
${
project
}
.jar
$command2
>
/dev/null 2>&1 &
nohup
java
$command1
$wechat_config
-jar
${
project
}
.jar
$command2
>
/dev/null 2>&1 &
echo
"日志名称:
$log_name
"
#if [[ $project == "redpacket" ]]; then
...
...
qa_shell_script/special_env_make/wechat_make.sh
View file @
f0c46e31
...
...
@@ -51,6 +51,20 @@ function reBuildProject()
expect eof
;
"
}
function reStartProject()
{
expect -c "
set timeout
10
spawn ssh root@
$2
expect
\"
]
#\"
send
\"
cd
/home/qa-deploy-utils/qa_shell_script/
\r\"
expect
\"
]
#\"
send
\"
sh 6_restart_by_wechat.sh
$1
"
$3
"
\r\"
expect
\"
]
#\"
send
\"
exit
\r\"
expect eof
;
"
}
echo "
部署时间大约需要10分钟,请确保重启应用时,配置文件不再更改。。。
"
echo "
部署new-xyqb-user-ui
"
...
...
@@ -61,14 +75,16 @@ ssh root@192.168.4.3 "sed -i \"s#wechattest.xyqb.com#$user_url#g\" $base_path/$e
reBuildProject
"new-xyqb-user-ui"
"
$env_ip
"
echo
"部署xyqb-user2"
ssh root@192.168.4.3
"sed -i
\"
s#wechat.appid=.*#wechat.appid=
$dev_appid
#g
\"
$base_path
/
$env_ip
/java/xyqb-user2.properties"
ssh root@192.168.4.3
"sed -i
\"
s#wechat.appid=.*#wechat.appid=
$dev_appid
#g
\"
$base_path
/
$env_ip
/public/java/xyqb-user2.properties"
ssh root@192.168.4.3
"sed -i
\"
s#wechat.secret=.*#wechat.secret=
$dev_secury
#g
\"
$base_path
/
$env_ip
/java/xyqb-user2.properties"
ssh root@192.168.4.3
"sed -i
\"
s#wechat.secret=.*#wechat.secret=
$dev_secury
#g
\"
$base_path
/
$env_ip
/public/java/xyqb-user2.properties"
reBuildProject
"xyqb-user2"
"
$env_ip
"
# ssh root@192.168.4.3 "sed -i \"s#wechat.appid=.*#wechat.appid=$dev_appid#g\" $base_path/$env_ip/java/xyqb-user2.properties"
# ssh root@192.168.4.3 "sed -i \"s#wechat.appid=.*#wechat.appid=$dev_appid#g\" $base_path/$env_ip/public/java/xyqb-user2.properties"
# ssh root@192.168.4.3 "sed -i \"s#wechat.secret=.*#wechat.secret=$dev_secury#g\" $base_path/$env_ip/java/xyqb-user2.properties"
# ssh root@192.168.4.3 "sed -i \"s#wechat.secret=.*#wechat.secret=$dev_secury#g\" $base_path/$env_ip/public/java/xyqb-user2.properties"
comd
=
" -Dwechat.secret=
$dev_secury
-Dwechat.appid=
$dev_appid
"
reStartProject
"xyqb-user2"
"
$env_ip
"
"
$comd
"
echo
"部署xyqb"
ssh root@192.168.4.3
"sed -i
\"
s#h5-ui.url=.*#h5-ui.url=http://
$pay_url
#g
\"
$base_path
/
$env_ip
/java/xyqb.properties"
ssh root@192.168.4.3
"sed -i
\"
s#wechat.secret=.*#wechat.secret=
$dev_secury
#g
\"
$base_path
/
$env_ip
/public/java/xyqb.properties"
reBuildProject
"xyqb"
"
$env_ip
"
# ssh root@192.168.4.3 "sed -i \"s#h5-ui.url=.*#h5-ui.url=http://$pay_url#g\" $base_path/$env_ip/java/xyqb.properties"
# ssh root@192.168.4.3 "sed -i \"s#wechat.secret=.*#wechat.secret=$dev_secury#g\" $base_path/$env_ip/public/java/xyqb.properties"
cmd
=
" -Dh5-ui.url=http://
$pay_url
-Dwechat.secret=
$dev_secury
"
reStartProject
"xyqb"
"
$env_ip
"
"
$cmd
"
echo
"部署结束,如果之后修改代码,部署project后,请重新执行该部署脚本,否则有可能出现测试环境配置文件被回退的可能。"
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