Announcement

Collapse
No announcement yet.

newbie: how to run a post-commit batch file in VisualSVN?

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • newbie: how to run a post-commit batch file in VisualSVN?

    Hi,

    I would like to automatically perform svn update after any commits made to the repository. I have a batch file located on our Windows 2008 server, at C:\Repositories\repo\hooks\update.bat

    update.bat contains the following:

    "C:\Program Files (x86)\VisualSVN Server\bin\svn.exe" update "C:\inetpub\vhosts\web.com\httpdocs" --quiet --non-interactive --username usera --password passa --config-dir "C:\Program Files (x86)\VisualSVN Server\conf"

    Can someone please help me answer the following questions?

    1. How can I run this batch file as a post-commit script, using VisualSVN? ie, what do I need to type in the post-commit window, under the Hooks tab, in the repository properties?

    2. The repository is quite large (1.5GB). For minor commits (eg. one or two files), is this the ideal way to update, or would someone have a more efficient script they wouldn't mind sharing?

    3. Does the user (usera) need to be a windows user with read access to the httpdocs folder, or do they need to be a VisualSVN user?

    Any help to get this working would be greatly appreciated.

    Thanks..

  • #2
    Solved

    Hope this helps anyone else having this or similar issues...

    I added this line to the edit post-commit hooks window (in VisualSVN):

    C:\Repositories\repo\hooks\update.bat

    Modified the batch file I created (update.bat), as follows:

    "C:\Program Files (x86)\VisualSVN Server\bin\svn.exe" update "C:\inetpub\vhosts\web.com\httpdocs" --username usera--password passa --config-dir "C:\Program Files (x86)\VisualSVN Server\conf"

    I temporarily removed --non-interactive, and --quiet, and found when I ran the batch file to test at command prompt (on the server), it was prompting me to accept an SSL certificate. I chose [P] to permanently accept. The script then ran succesfully and one file that I had committed was updated.

    'usera' is a user I added in VisualSVN (not a Windows account).

    Now when our web developers commit changes to the repository, they will be automatically updated on our website.

    Thanks!

    Comment


    • #3
      Further update: only works on server

      Hi,

      Just discovered when I try to commit a file remotely, an error occurs when running the batch file:

      post-commit hook failed (exit code 1) with output:
      svn: Error resolving case of 'C:\inetpub\vhosts\web.com\httpdocs'

      Tried changing this path in the batch file, to:

      https://web.com:8448/svn/repo

      Now when I svn commit remotely I am not getting an error, but the update isn't working. Running this locally on the server, I get a cryptic message:

      Skipped 'https://web.com:8448/svn/repo'

      Can anyone please explain why this would be happening?

      Thanks very much..

      Comment

      Working...
      X