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?
Do the following in the VisualSVN Server Manager MMC console:
Select your repository
Right click Properties
Select the Hooks tab
Select the post-commit hook
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>
Click Ok.
Find your SVN server installation directory (I have
C:\Program Files\VisualSVN Server\bin
).Drop an executable or batch file that does whatever you want in there, and set the post-commit hook to something like this:
postcommit.exe "%1" "%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
Will do the reading on Cruise Control integration with Subversion - first I've heard of it, though I do hate to throw yet another variable into the mix.
Looked at the VisualSVN link before posting the question, but it doesn't explain how to do anything with VisualSVNServerHooks.exe other than email notification. Can't help but wonder if that is the only feature VisualSVNServerHooks.exe supports, since I could not locate documentation of any other functionality with it on their site, docs, google groups, google search, etc.
Thanks for posting.
© 2022 - 2024 — McMap. All rights reserved.