Synchronize Visual SVN with IIS for web development (or in any other folder)

How to get the latest version of the project file in a different folder with each commit?

I am using a VisualSVN server, and I think we can do this on post-fixing on hooks, but I don't know how to do this. The server is on Windows.

Actually, I need to get the latest version of the file in the \www IIS7 folder. Just upload the latest file to another folder.

+2
source share
3 answers

I added the following code to the post-commit hook (to copy the latest version files to D:\Destination ).

 svn export --force file:///D:/Repositories/myproject D:\Destination exit 2 

This works great for me.

If you are trying to export this to a website directory, you need to change the directory permissions. Visual SVN uses the NETWORK SERVICE.

+3
source

If you use the same file in more than one folder inside your repository, and Subversion is 1.6 or later, you can use the svn: externals file type without reference to the revision.

In this case, fixed in the SOURCE file will be updated in the working copy of TARGET after the usual svn up

+1
source

but I dont know how

You correctly say that you need to do this by post-fixing, but if you mean that you do not know the process, here's how.

Your post commit is a script that gets called after every project commit in your SVN repository. There is a file called post-commit in the hooks folder of each repository. Modify the file to include the necessary * commands in order to copy for you and make it post-commit.exe .

Then each time you make a new revision, the script should process it for you.

* Under the necessary commands, I mean either copying using the Windows command line, or calling another script to complete the job from post-commit.exe .

Also, although the SVN docs mention that the post-commit hook must be either .bat or .exe , I only worked when it was .exe on my machine.

You can convert the .bat files to binary .exe using the tools available here and. The second is much more convenient. Hope this helps.

+1
source

Source: https://habr.com/ru/post/1392375/


All Articles