公司SVN版本提交钩子post-commit.bat

  1. SET REPOS=%1  
  2. SET REV=%2  
  3. SET SVN_HOME_BIN=C:\svnServer\bin\  
  4. SET SVNUpdatePath=E:\svnupdate\gamebto\update\gamebto_new  
  5. SET VERPath=E:\svnupdate\gamebto\version\%date:~0,4%-%date:~5,2%-%date:~8,2%  
  6. SET WEBPath=E:\web\gamebto  
  7. SET WEBPath2=\\192.168.14.16\web\gamebto  
  8. SET WEBPath3=\\192.168.14.78\web\gamebto  
  9. SET WEBPath4=\\192.168.14.80\web\gamebto  
  10. SET ChangeList=E:\svnupdate\gamebto\logs\%date:~0,4%.%date:~5,2%.%date:~8,2%_%REV%.txt  
  11. %SVN_HOME_BIN%svnlook changed %REPOS% > %ChangeList%  
  12. %SVN_HOME_BIN%svn update %SVNUpdatePath%  
  13. E:  
  14. FOR /F “eol=; tokens=1 delims=” %%a in (%ChangeList%) do (FOR /f “tokens=1,2,* delims= “  %%i in (“%%a”do IF %%i==D (DEL %VERPath%%%~pnxj|DEL %WEBPath%%%~pnxj|DEL %WEBPath2%%%~pnxj) ELSE (echo f| xcopy %SVNUpdatePath%%%~pnxj %VERPath%%%~pnxj /R /Y /C|echo f| xcopy %SVNUpdatePath%%%~pnxj %WEBPath%%%~pnxj /R /Y /C|echo f| xcopy %SVNUpdatePath%%%~pnxj %WEBPath2%%%~pnxj /R /Y /C|echo f| xcopy %SVNUpdatePath%%%~pnxj %WEBPath3%%%~pnxj /R /Y /C|echo f| xcopy %SVNUpdatePath%%%~pnxj %WEBPath4%%%~pnxj /R /Y /C)); 

Leave a Reply

Your email address will not be published.