SVN Post Commit Hook Batch Windows

I have a Windows Server with Visual SVN Server to store our repositories. Also on this server is our test copy.

I'm trying to set up a simple SVN post commit, so it automatically updates the test copy every time I commit something

In Visual SVN, in post-commit hooks, I configured this as

"C:\Program Files (x86)\VisualSVN Server\bin\updatescripts.bat" D:\inetpub\TESTCOPY

Then this batch file has a simple update like this

PATH=%PATH%;"C:\Program Files (x86)\VisualSVN Server\bin\"
svn update %1

If I run the batch file on the server, double-clicking on it or from the command line works fine. When I did something from my laptop, it freezes and does not give me any error and blocks a test copy, so I need to log in and start cleaning.

The Visual SVN service runs as a network service, and this aacount has full access to the bin folder and test copy on the server.

, svn update post, -?

+3
4

, , SVN .

:

set MYPATH=%1

:: Transform backslashes to forward slashes
set MYPATH=%MYPATH:^\=/%

svn update %MYPATH%
+1

svn update. ?

- . , , Subversion. , .

Subversion , . - svnlook, svn. , - .

Subversion , :

PATH=%PATH%;"C:\Program Files (x86)\VisualSVN Server\bin\"
set SVN_WORK_DIR=C:\SVN\workdir"
svn update %SVN_WORK_DIR%

, Subversion. , , , Subversion .

+1

, ...

- "C:\Program Files\VisualSVN Server\bin\svn.exe" update "C:\my path \" - .

0

It really is not how you want it. What you have to do is use something like Jenkins to view your repository. Jenkins can watch your repository, and when it changes, updates the test copy, starts the build, runs the automatic tests, etc.

0
source

All Articles