技术宅,fat-man

增加语言的了解程度可以避免写出愚蠢的代码

导航

bat写的自动部署脚本

windows7的机器上重启服务需要关闭UAC

::编译部署项目
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

 

posted on 2015-06-14 17:04  codestyle  阅读(713)  评论(0编辑  收藏  举报