1. 程式人生 > >linux主機上webservice專案部署指令碼

linux主機上webservice專案部署指令碼

簡單的專案部署指令碼示例[初學]

#!/bin/sh
#  This script is used for deploying batch quickly.But you need to upload the deploy package named batch to the directory bellow
#  [/app/weblogic/Oracle/Middleware/user_projects/domains/Domain/servers/AdminServer/upload/AUTODEPLOY]
#  Written by LeonWang
domain=/app/weblogic/Oracle/Middleware/user_projects/domains/Domain/
timestamp=`date +%y%m%d_%H%M%S`
#FistStep:Kill the batchSrv processor
echo "== 1 == kill the batchSrv processor" batchSrvPid=`ps -ef|grep Dweblogic.Name=batchSrv|grep -v 'grep'|awk '{print $2}'` if [ -z "$batchSrvPid" ] then echo processor of batchSrv is not exist else kill -9 $batchSrvPid echo "processor of batchSrv bas been killed." fi #SecondStep:clean the cache echo
"== 2== clean the cache" rm -rf $domain/servers/AdminServer/tmp/_WL_TEMP_APP_DOWNLOADS/batch rm -rf $domain/servers/batchSrv/tmp/_WL_* #ThirdStep:backup old deploy package echo "== 3 == backup old deploy package to $domain/servers/AdminServer/upload/batch_bak$timestamp" mv $domain/servers/AdminServer/upload/batch $domain
/servers/AdminServer/upload/batch_bak$timestamp #FourthStep:mv the deploy package to uploading directory echo "== 4 == upload the deploy package" cp -r $domain/servers/AdminServer/upload/AUTODEPLOY/batch $domain/servers/AdminServer/upload/batch #FifthStep:start the server batchSrv echo "== 5 == start the server batchSrv" nohup $domain/bin/startManagedWebLogic.sh batchSrv http://localhost:7001/