bat寫的自動部署腳本

windows7的機器上重啓服務須要關閉UACweb

::編譯部署項目
echo off
echo 1. GatewayAdaptor
echo 2. LogicService
echo 3. MessagePushAdapter
echo 4. PhoneAdaptor
echo 5. StatusService

set /p key=

set projectName=projectName
set deployName=deployName
if %key% == 1 set projectName=GatewayAdaptor
if %key% == 1 set deployName=GatewayAdaptor
if %key% == 2 set projectName=LogicService
if %key% == 2 set deployName=LogicService
if %key% == 3 set projectName=MessagePushAdapter
if %key% == 3 set deployName=MessagePushAdaptor
if %key% == 4 set projectName=PhoneAdaptor
if %key% == 4 set deployName=SmartPhoneAdaptor
if %key% == 5 set projectName=StatusService
if %key% == 5 set deployName=DeviceStatusRegister
if %projectName% == projectName exit

echo on
set projectDir=D:\SourceCode\Platform\trunk\%projectName%
set targetDir=%projectDir%\target
set deployDir=D:\Tomcat\%deployName%\webapps

sc stop %deployName%
cd /d %projectDir%
svn update
cmd /c grails clean-all
cmd /c grails dev war %deployDir%\%projectName%.war

:: restart service
sc start %deployName%

cd D:\SourceCode
pause
相關文章
相關標籤/搜索