1
votes

I want to checkout the most recent files of the repository to a folder on the local hard drive of the server whenever a commit happens.

My post-commit hook right now is:

svn checkout https://xyz.mysite.com:7405/svn/ProjectName/ C:\my-temp --non-interactive --no-auth-cache --username myusername --password mypassword

The .CMD file that VisualSVN Server created runs great inside Windows's Command Prompt and does what I need it to do. But when it comes to running it when a commit happens, an error gets returned to the SVN client and nothing appear in the destination folder.

The error message says Access to /svn/ProjectName forbidden even though the credentials work perfectly in Commpand Prompt.

Please let me know what I need to do to the script for the hook to run. Thanks!

1

1 Answers

0
votes

Do you have Integrated Windows Authentication (i.e. Active Directory Single Sign-On) enabled on the server? In such case, --username and --password arguments won't work because svn.exe, when called from the hook script, will authenticate under the user account that runs VisualSVN Server HTTP service.

There are several ways to get rid of the authentication problem:

  • If you run the service under Network Service (HTTP service runs under this account by default), provide the AD computer account with Read permissions to /svn/ProjectName/. Network Service account works under computer account's credentials on the network.

  • Run svn checkout against file:// URL. This way the client access the repository directly on the filesystem and no special authentication is required. The URL should look like file:///C:\Repositories\MyProject.