I have just setup VisualSVN on my local machine and on our server that hosts our websites. I used the standard default settings when installing the software but I'm a bit confused how to use this with our setup.
I have tested the installation and everything appears to be working ok. In Visual Studio 2008, I can connect to and commit the website files to the server successfully using "IP of server/svn/domainname folder". If I point my browser to the url "IP of server/svn/domainname folder" and enter my username and password I see a folder tree with all of the files I just uploaded. So that bits working fine.
My question is how could we test the website I just uploaded? On our server all our websites are stored in "C:\sites\domainname" folders. In IIS we map that folder to the domain name so when someone types in domainname.com they get the right website. How do I config the Visual SVN server setup to allow me use the "C:\sites\domainname" setup we currently have?
Any help would be greatly appreciated as I'm totally confused by this.
You could do a post-commit hook, that would SVN EXPORT the server to the deploy path.
I think you're confused about what VisualSVN is:
VisualSVN Server is a package that contains everything you need to install, configure and manage Subversion server for your team on Windows platform. It includes Subversion, Apache and a management console.
It's a slick package that contains everything you need to run a Subversion source control server on a Windows machine. I love it. Normally you would not install this on a machine that also hosts websites, and I would definitely not do it on one that hosts public facing sites.
Subversion is just a source control system. It doesn't change anything about how you deploy sites.
At my company, we accomplished this with the following solution:
- Set up a hudson CI server to build our products on a regular basis by polling SVN
- The build artifacts get copied to a folder like c:\artifacts in a build step in the project configuration.
- We then made a custom apache config file in C:\Program Files\VisualSVN Server\conf\httpd-custom.conf (don't modify httpd.conf; it gets overwritten during updates, etc.)
We then added the following to httpd-custom.conf:
LoadModule alias_module bin/mod_alias.so
<Directory "C:/artifacts">
Options Indexes
AllowOverride None
</Directory>
<IfModule alias_module>
Alias /artifacts C:/artifacts
</IfModule>
Now http://svn.example.com/artifacts/ acts as the testing site, and gets updated automatically whenever any developer commits code to SVN.
I've never used VisualSVN, but I think that generally, with SVN and webservers, you do a checkout of the appropriate code into C:\sites\domainname.
Then, when you want to push code onto the server, you can run an SVN Update on that directory (assuming the appropriate changes have been pushed into subversion). Obviously I would test this using a test domain and another directory before hand (or just browsing a test directory with IIS).
Personally though, since I use asp.net and C# and use Web Deployment Projects to pre-compile, I generally just move builds myself instead of messing with SVN on the webserver. With interpreted languages such as PHP it's more straight forward.
My svn client on windows is ToirtoiseSVN
Sounds like you need to check these websites out from subversion to the web server. Map a virtual drive in IIS to those folders.
Edited for clarity.
The problem is that subversion does not store the files normally on the hard disc. It uses a database or a virtual file system to store the file. This is necessary for versioning them.
The simplest way do the job would be to use a subversion command line client and write a little batch file which checks out the head-version of your subversion repository and copies the files to your IIS folder. You can call the batch file periodically by a cronjob.