# author wangyang
# buildtime 12-06-05
# desc 自動部署指令碼
currentdir=`pwd`
#判斷命令是否成功執行
isok()
#依次執行命令
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
#強制殺掉已執行的程序
ps -ef | grep sync_new | grep -v grep | awk '' | 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
自動部署指令碼 Linux shell
技術文件 linux,shell,自動部署,tomcat ssh key 自動登入 免密碼登入 生成ssh key 在本機 用ssh keygen t rsa命令生成公鑰,ssh 下生成 id rsa,id rsa.pub 兩檔案 講公鑰上傳至遠端伺服器 並新增到authorized keys檔案中...
應用自動部署指令碼
應用部署 進入 192.168.1.167 的 home admin scm 目錄 執行 sh build.sh 就行了.1.配置tomcat目錄 scm script build.properties catalina.home 這個為tomcat安裝的目錄.比如我這邊是 usr src apac...
vue 專案 部署指令碼 自動部署
用vuejs開發快兩年了,不得不說vue是個好框架,當時在前期部署的時候每次都很頭疼,因為次次都要很麻煩,不同的環境,測試機,需要管理很多ip使用者名稱,所以想封裝乙個指令碼,只需要修改對應的配置檔案,就可以乙個命令去部署 廢話不多說,在這個指令碼執行前,需要配置部署機器的ssh key 到伺服器的...