views:

472

answers:

4

I installed VisualSVN on a server that I am using to "stage" web applications that I write - at the present time these applications are Classic ASP/VBScript. My development workstation that I write code on has TortoiseSVN installed, and I can connect to the repository folder I created - I'm using the following structure:

development (repository)
  -- my_application
     -- branches
     -- tags
     -- trunk
  -- another_application
     -- branches
     -- tags
     -- trunk

I also have IIS configured and pointing to another folder on the server's hard drive to store the served files. Is there a "best practice" for pushing commits out to the folder linked to IIS, so after a commit/iteration I can give my users a URL to see the demo site (as well as test it myself)? I am ashamed to say that I have never really used version control before, so I am a little bit clueless as to the best way to use it.

+2  A: 

I can see you've done your homework, your repository layout is set up by the book. I'm not sure what VisualSVN does in terms of check-outs, but if you want to push changes to a web site, it's easy to do, either interactively or scheduled.

cd to webhome

svn co [svn-project-uri]

Chris Kaminski
If your staging server has access to the repository, it's easy peasy. Just export it each time or do a checkout and update it to push updates out. This will work for your code only, not database changes.
Samuel
A: 

First of all, I recommend you to keep different applications in different repositories.

Each commit increases revision number, so you could get next situation: first application has no updates for a long time, but it's revision number continually increases because of a second application updates.

abatishchev
I recommend against separate repositories. Any svn client worth its damn will show you the appropriate revision. Having one revision makes backup so easy compared to several repositories.
Samuel
I don't see the disadvantage of separate reps. In a history you'll see that nothing has changed. And a revision is only a number, no deeper meaning.
boutta
@boutta, is that towards me or abatishchev? Because your comment is confusing. Are you for or against separate repositories?
Samuel
Yeap, revision is only a number, but its changes means that there are some code changes inside. But in case of single repository, you would get changes without it in fact. I think that isn't useful. Just an opinion, of course.
abatishchev
Your logic could be applied to each and every file in your repository. You should use a one file per repository policy since a file maybe be at revision 150 but hasn't been changed since revision 100. Shared revision numbers for each of your projects is not a reason to not use a single repository.
Samuel
There is another reason - if the count of developers is more then 1, you probably would have to make some security differentiations. You cannot change access rights to a directory inside a repository, because it's virtual. But you can do that for each directory-separate-repository
abatishchev
Not true buddy. Both svnserve and DAV-svn have support for per repository, per directory, and ever per file permission support.
Samuel
So just to be aware of best practices - it's better to create a separate repository for each project (e.g. AppA, AppB, AppC), instead of a single repository ("development" in my case) with different folders (one "master" per application) branching off of that?
Wayne M
There really isn't a 'better' way. Both have advantages and disadvantages. One repository is easier to backup but if you don't back it up enough you could lose everything since your last backup if the repository gets corrupted.
Samuel
As Steve W confirmed below, I'm sure that the best practice is one repository for one application.
abatishchev
And about security - I mean security rights on the level of Domain/NTFS. On my job we uses it. Developers has full access, testers - read-only. It's very easy to setup it using NTFS rights on each repository-directory
abatishchev
+4  A: 

First, I would concur with the other comments, your repository format is by the book with branches, tags, and the trunk. I would also recommend splitting the repository per project as mentioned. I've been involved in projects that have one shared repository and with split repositories, and the split repositories work better. Plus, if there was ever a reason to limit access to one of the repositories (ie, you were letting someone else access the repository, and you only wanted them to see one of the two projects) its easier with them separated.

In any case, I would suggest using MSBuild for your deployment. You can create an MSBuild project file that checks out from SVN, builds your solution file, then deploys it to the web site. You would add a line such as this to your MSBuild project file to do the checkout:

<Exec command="svn checkout %22https://server:8443/svn/Project/Trunk/%22 %22c:\Project%22"/>

You can also do things such as making a project to checkout a specific version/tag once you release a version. There's quite a bit of flexibility in what can be done when going this route for deployment.

For more details on MSBuild, you can find the Microsoft MSBuild Reference Guide here.

Steve Wranovsky
Not convinced on "one repository per project". Subversion handles huge repositories just fine, and having just the one reduces maintenance overhead. Just one repository to backup, only one authz file to maintain, no additional apache configuration for new projects...
Wim Coenen
A: 

If you wish to automatically build or deploy when every there is a check in to Subversion you should consider using a Continuous Integration server. I personally like CruiseControl.NET, however there are many other chooses.

Ian Ringrose