自动部署脚本
来源:互联网 发布:海信32寸智能网络电视 编辑:程序博客网 时间:2024/06/13 19:49
# author wangyang
# buildTime 12-06-05
# desc 自动部署脚本
currentDir=`pwd`
#判断命令是否成功执行
isOk(){
if [ $1 = 0 ];then
echo ok
else
echo wrong
fi
}
#依次执行命令
rm -rf sessionserver* tradecore tradeweb
isOk $? > deploy.log
tar xzvf my.tar
isOk $? >> deploy.log
cp -r sessionserver sessionserver_P1
isOk $? >> deploy.log
sed -i '/ServerName/s/s1_2/s1_1/' $currentDir/sessionserver_P1/dist/MEBS_timebargain.xml
isOk $? >> deploy.log
cp -r sessionserver sessionserver_P2
isOk $? >> deploy.log
cp -r sessionserver sessionserver_M1
isOk $? >> deploy.log
sed -i '/ServerName/s/s1_2/m1_1/' $currentDir/sessionserver_M1/dist/MEBS_timebargain.xml
isOk $? >> deploy.log
sed -i '/MultiMode/s/1/2/' $currentDir/sessionserver_M1/dist/MEBS_timebargain.xml
isOk $? >> deploy.log
cp -r sessionserver sessionserver_M2
isOk $? >> deploy.log
sed -i '/ServerName/s/s1_2/m1_2/' $currentDir/sessionserver_M2/dist/MEBS_timebargain.xml
isOk $? >> deploy.log
sed -i '/MultiMode/s/1/2/' $currentDir/sessionserver_M2/dist/MEBS_timebargain.xml
isOk $? >> deploy.log
sed -i '/ServerName/s/tr1/localhost\.localdomain/' $currentDir/tradecore/dist/MEBS_timebargain.xml
isOk $? >> deploy.log
cp -r $currentDir/tradeweb/build/classes $currentDir/tradeweb-tomcat6/webapps/tradeweb/WEB-INF
isOk $? >> deploy.log
cp $currentDir/tradeweb/libs/runtime/* $currentDir/tradeweb-tomcat6/webapps/tradeweb/WEB-INF/lib
isOk $? >> deploy.log
#强制杀掉已运行的进程
ps -ef | grep sync_new | grep -v grep | awk '{print $2}' | xargs kill -9
isOk $? >> deploy.log
#逐个开启进程
cd $currentDir/sessionserver_P1/dist
bash startSession.sh
isOk $? >> $currentDir/deploy.log
cd $currentDir/sessionserver_P2/dist
bash startSession.sh
isOk $? >> $currentDir/deploy.log
cd $currentDir/sessionserver_M1/dist
bash startSession.sh
isOk $? >> $currentDir/deploy.log
cd $currentDir/sessionserver_M2/dist
bash startSession.sh
isOk $? >> $currentDir/deploy.log
cd $currentDir/tradecore/dist
bash startCore.sh
isOk $? >> $currentDir/deploy.log
cd $currentDir/tradeweb-tomcat6/bin
bash startup.sh
isOk $? >> $currentDir/deploy.log
#根据命令成功执行条数,判断是否部署成功
#cd -
cd $currentDir
num=`cat deploy.log | grep -o ok | wc -l`
if [ $num = 21 ]; then
echo 'bu shu cheng gong' >> deploy.log
fi
- 自动部署脚本
- LNMP自动部署脚本
- SVN自动部署脚本
- 通用自动部署脚本
- linux自动部署脚本
- SVN+Nginx自动部署脚本
- web应用自动部署脚本
- Jenkins tomcat自动部署脚本
- 自动部署脚本 Linux shell
- shell 脚本php自动部署
- tomcat自动部署代码脚本
- 项目自动打包部署脚本
- 制作linux自动部署脚本
- jenkins自动部署tomcat脚本
- maven git自动部署脚本
- bash 脚本编程十一 JDK自动部署
- bash 脚本编程十四 maven自动部署
- bash 脚本编程十五 MySQL自动部署
- 女人必知 教你认清6种隐性坏男人
- TimerTask is scheduled already 异常
- ubuntu 下同步google chrome 书签
- Chrome自动更新问题的解决办法
- 自动化部署脚本
- 自动部署脚本
- [数据结构]单链表反转
- 计通网实验的准备工作(2):成帧实现(C语言)
- c++ 指针,引用,* 与&
- 苹果宣告全球开发者大会将于6月2日召开
- 自动化部署脚本
- 学习笔记 --- LINUX 应用调试之编写之事件记录与自动重现
- There is no Action mapped for namespace / and action name
- 《APUE》chapter 12 Thread control 学习笔记(加上自己的代码)