从VSS自动拉下文件/编译/发布到服务器一条龙(无人工干预)
1)build.bat
Call "D:/App/ant162/bin/ant.bat" -buildfile=build_vss_ant.xml
wscript.exe //e:vbscript build.vbs
2)build_vss_ant.xml 核心内容
<target name="getSource" depends="init">
<vssget vsspath="${vss.path}/" localpath="." login="james.wang,123456"
ssdir="${vss.ssdir}" serverPath="${vss.svrdir}"
autoresponse="Y" recursive="true" quiet="false" writable="true" writablefiles="replace"/>
</target>
3)build.vbs 核心内容(模拟键盘输入口令,上传到FTP或者SSH的Linxu的服务器,这里需要把SSH Client安装文件拷贝到当前目录下,因为原先的安装目录可能包含空格,VBS不支持)
Dim WshShell, GamePath
GamePath="./ssh/scp2.exe -r ./webapps root@10.144.177.222:/usr/DMA"
Set WshShell=WScript.CreateObject("WScript.Shell")
WshShell.Run GamePath
WScript.Sleep 2000
WshShell.AppActivate "ttt"
WshShell.SendKeys "hgre@dy"
WScript.Sleep 200
WshShell.SendKeys "{ENTER}"
#这里
------------------------
将build.bat设置成Windows的定时任务就可以每天晚上编译发布了。
对于windows下的操作就更简单了
------------------------------------------------------------------------------------------------------------------------
mkdir aricept
svn checkout http://svn-dgts.lemon-asia.com/svn/Pfizer-AriceptII/src/ --username leslie.sheng --password 123456 aricept
svn update http://svn-dgts.lemon-asia.com/svn/Pfizer-AriceptII/src/ --username leslie.sheng --password 123456 aricept
net use m: /delete
net use m: //10.144.176.139/woodyprj 1234 /USER:administrator
xcopy aricept m:/aricept02 /E /C /I /F /R /Y
net use m: /delete
------------------------------------------------------------------------------------------------------------------------