Advertisement
Guest User

VisualSVN Post-Commit Hook for Windows

a guest
Jun 14th, 2011
1,377
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.12 KB | None | 0 0
  1. SET REV=%2
  2. SET REPOS=%1
  3. SET DIR=%REPOS%\hooks
  4. SET REPOS=%REPOS:C:\Repositories\=%
  5. SET WORKING_COPY=\\192.168.222.41\Web01-Inetpub\%REPOS%.
  6. SET PATH=%PATH%;%DIR%;C:\Utils\;C:\Program Files\VisualSVN Server\Bin
  7. SET SVN_USER=svnusernamehere
  8. SET SVN_PASS=svnpasswordhere
  9. SET SMTP_SERVER=smtpserveraddresshere
  10. SET SMTP_USER=smtpusername
  11. SET SMTP_PASS=smtppassword
  12. SET SUBJECT=SVN Update - %REPOS% - Revision %REV%
  13.  
  14.  
  15. REM Push update to working copy directory
  16. svn.exe update %WORKING_COPY% --quiet --non-interactive --username %SVN_USER% --password %SVN_PASS%
  17.  
  18. REM Write revision number to .revision file in working copy directory
  19. ECHO %REV% > %WORKING_COPY%\.revision
  20.  
  21. REM Send notification email of changes
  22. ECHO The following changes were made to the code: > %DIR%\email.txt
  23. ECHO. >> %DIR%\email.txt
  24.  
  25. svn log %WORKING_COPY% -v -r "%REV%" --non-interactive --username %SVN_USER% --password %SVN_PASS% >> %DIR%/email.txt
  26.  
  27. sendEmail -s %SMTP_SERVER% -t %EMAIL_TO% -f %EMAIL_FROM% -u "%SUBJECT%" -o message-file=%DIR%\email.txt -xu %SMTP_USER% -xp %SMTP_PASS%
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement