Setting up Visual SVN for real world use

我是研究僧i 提交于 2019-12-06 09:38:40

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!