Showing posts with label Subversion. Show all posts
Showing posts with label Subversion. Show all posts

Wednesday, 6 August 2008

Some comments about TFS

[I tried to leave this as a comment to "How credible is TFS’s success anyway?" (http://clangalyon.wordpress.com/2008/03/03/how-credible-is-tfss-success-anyway/), but I guess I am not smart enough to leave a comment to a post on wordpress :)]

I moved the source code for my last 2 employers from VSS to TFS 2005, and now I am just awaiting to move a TFS 2005 plus various VSS repositories to TFS 2008. I have experiences with implementing and managing CVS and SVN as well (actually my previous employer asked me to move from TFS 2005 to SVN, 'cause TFS was not up to the task for our requirements).
I haven't seen yet TFS 2008, but I can tell you that the CI in TFS 2005 was at prototype level, at last 1 order of magnitude slower than CCNET (so far, we ever went the CCNET way).
The version control (VC) was better, and in most shop you can live with its performances, especially if you use a dedicated SQL Server and spend some time tuning it. There are some bugs you cannot work around, and also Microsoft is not that quick to help (I am still waiting for a fix since quite a long time), but all in all is probably less buggy than SVN at the same age, and it is so much an improvement compared with CVS and especially VSS. I have very good hopes for the VC component on TFS 2008, but I can't really see myself recommending TFS implementation of CI against CCNET very soon.
That said, from a theoretical point of view, I believe on certain scenarios software like darcs or git are going to be a better choice over any client/server SCM.

Monday, 5 February 2007

CruiseControl.Net and SVN over SSL

On Microsoft Windows (2003 and XP) CruiseControl.Net is usually running as a service under the Local System Account (LSA), but, to update the working copy used from the integration service using a SVN repository contacted through SSL, we have to accept permanently the server certificate.
To achieve that, we have to log as Local System, which is accomplished using the command at with the interactive switch. In example, let's suppose that the time is 16:59, running the following command we'll open a Command Prompt running as LSA:
at 17:00 /interactive cmd.exe
Once logged in as LSA, it is just a matter of launching a svn up (or another command which is permitting us to save the server certificate) from the desidered working copy folder
, and to accept permanently the server certificate.
The server certificate will be then saved on the $UserProfile\Application Data\Subversion\auth\svn.ssl.server folder (where in the case of the LSA $UserProfile is usually something as C:\Documents and Settings\LocalService\).
Warning: no, you cannot log as LSA using the abovementioned trick from a terminal server. Use the console!

Tuesday, 30 January 2007

How to install Subversion 1.4.x with Apache 2.2.x and mod_ssl on Microsoft Windows

General guidelines to install Subversion 1.4.x with Apache 2.2.x and mod_ssl on Microsoft Windows. Use the following instructions at your own risk.

Subversion

The home page of the Subversion project is http://subversion.tigris.org.
The files we need to install Subversion 1.4.x with Apache 2.2.x are currently on this folder, and as for the 25th January 2007, the needed binary package is svn-win32-1.4.3.zip (this file has to be the one builded for Apache 2.2.x).
To install Subversion 1.4.x take the following steps:
  • Unzip the svn-win32-1.4.3.zip file then move its content on a directory as %ProgramFiles%\Subversion (or %ProgramFiles(x86)%\Subversion on X64 systems);
  • Add %ProgramFiles%\Subversion\bin to the environment variable path.
  • Optionally, look for the hot-backup.py script on the source code of Subversion (ideally, get it from the same SVN branch/tag from which the previous binary package was builded) and save it in the %ProgramFiles%\Subversion\tools\backup directory (create it if needed).
  • Create the repository container directory (i.e. e:\repositories);
  • Create the configuration directory (i.e. e:\repositories\etc);
  • Create the backup directory (i.e. e:\repositories\backup);
  • Create a svnserver.conf file inside the configuration directory (i.e. e:\repositories\etc\svserver.conf);
The svnserver.conf file may look like this:
<location>
DAV svn
SVNPath e:/repositories/myProject
SVNIndexXSLT /svnindex.xsl
AuthName "Subversion Authentication"
AuthType SSPI
SSPIAuth On
SSPIAuthoritative On
SSPIDomain INTERNAL
SSPIOfferBasic On
Require valid-user
AuthzSVNAccessFile "e:/repositories/myProject/authorization.conf"
</location>
Note that is just an Apache directive, that obviously you may use more than one such directive if you plan to manage more than one SVN repository, and that this is how it would look like in the case of Active Directory authentication. To get an introduction to the Authentication, read the Authentication Options section of the SVN Book.

Apache

The home page of the Apache HTTP Server project is http://httpd.apache.org, but because we wish to use mod_ssl, and because for various reasons the Apache community doesn't provide a binary package for Microsoft Windows with such a module, another place to look for those binaries is Steffen Land's Apache Lounge.
The files we need to install Apache 2.2.4 are currently on this folder, and as for the 25th January 2007, the needed binary package is httpd-2.2.4-win32-x86-ssl.zip. Given that this binary is build with Microsoft Visual C++ 2005 SP 1, you may need to install the latest Visual C++ 2005 Redistributable Package (i.e. from here).
Another quite useful resource that provides binary packages for Apache is the Unofficial Apache webserver binaries / module binaries, where we can find a graciously packaged mod_auth_sspi. To install Apache 2.2.x take the following steps:
  • If you have IIS installed on same machine, stop it now. If you wish to use Apache and IIS on same machine using port 80 on different IP addresses, you should understand what Socket Pooling is, and how to disable it (in IIS 5 and IIS 6);
  • Unzip the httpd-2.2.4-win32-x86-ssl.zip file then move its content on a directory as c:/Apache2;
  • Copy the unzipped mod_auth_sspi.so in the c:/Apache2/modules directory;
  • Copy the mod_dav_svn.so and the mod_authz_svn.so modules from the %ProgramFiles%\Subversion\bin directory in the c:/Apache2/modules directory;
  • Tweak with the c:/Apache2/conf/httpd.conf configuration file until you will not get Apache working. How to tweak that configuration file to get Apache working is out of the scope of this document, but usually it involves fixing a few file system paths, IP numbers, DNS names and port numbers, and testing these fixes invoking Apache with the -t switch (i.e. as in C:\Apache2\bin\httpd.exe -w -t -f "C:\Apache2\conf\httpd.conf" -d "C:\Apache2\.") until there are not configuration error reported. Once Apache is properly configured, backup the httpd.conf file, and then start editing that:
    • In the section entitled # Dynamic Shared Object (DSO) Support, after the line starting with #LoadModule auth_digest_module modules/mod_auth_digest.so, add the LoadModule directive to load the module to support the Active Directory:
      LoadModule sspi_auth_module modules/mod_auth_sspi.so
      To get more informations about this module, check its home page;
    • In the same section, uncomment the lines to load the modules to support WebDAV:
      LoadModule dav_module modules/mod_dav.so
      LoadModule dav_fs_module modules/mod_dav_fs.so
      To read more about those modules, read the Apache documentation about mod_dav and mod_dav_fs;
    • After the latter lines, add the following lines to load the modules to integrate Subversion:
      LoadModule dav_svn_module modules/mod_dav_svn.so
      LoadModule authz_svn_module modules/mod_authz_svn.so
      To read more about those modules, read the sections of the SVN Book about mod_dav_svn and mod_authz_svn;
    • Uncomment the module to support ssl:
      LoadModule ssl_module modules/mod_ssl.so
      To read more about this module, check its home page;
    • Uncomment the following Include directive:
      Include conf/extra/httpd-ssl.conf
  • Start editing the httpd-ssl.conf file:
    • Set the SSLCertificateFile Directive, as in:
      SSLCertificateFile c:/Apache2/conf/ssl/yourwebsitecertificate.crt
    • Set the SSLCertificateKeyFile, as in:
      SSLCertificateKeyFile c:/Apache2/conf/ssl/yourprivatekey.key
    • Add the following line, before closing the VirtualHost directive:
      Include c:/repositories/etc/svnserver.conf
    Obviously, how to generate the private key, its correspondent .csr and the web certificate its widely outside of the scope of the present document, anyway documents as The Apache + SSL on Win32 HOWTO, the Generating an SSL Certificate with Apache+mod_ssl, the mod_ssl FAQ List (especially this entry) should be quite useful, as well the CAcert documents and services.