Using post commit hook to export in VisualSVN Server

10,067

Solution 1

Do the following in the VisualSVN Server Manager MMC console:

  1. Select your repository

  2. Right click Properties

  3. Select the Hooks tab

  4. Select the post-commit hook

  5. Click the Edit button. Enter a line like this into the textbox:

    "%VISUALSVN_SERVER%bin\svn.exe" export https://svn.yourserver.com:4433/svn/YourRepository/Websites/YourWebsite/ C:\inetpub\wwwroot\YourWebsite --quiet --non-interactive --force --username <youruser> --password <yourpassword>
    
  6. Click Ok.

Solution 2

If you install the svn command-line client you can write a simple post-commit hook script like this:

path\to\svn.exe export file:///%1/trunk path\to\where\you\want\to\export\to

I'm not sure whether the VisualSVN Server commit hook dialog creates a .bat / .cmd file or just expects to run the command. If the first, the line above would be enough. If the latter, first create a .bat file with the above line in it, then put in the dialog:

cmd.exe /C path\to\your\batfile
Share:
10,067
Admin
Author by

Admin

Updated on June 11, 2022

Comments

  • Admin
    Admin about 2 years

    What is the easiest way to use post-commit hook with VisualSVN Server to export from the repository to a directory for staging / testing after a developer commits his changes?