Yesterday I cam across an issue while integrating a project in our CruiseControl.Net (CC). We needed a file from a project to be checked out always on the CC server. This is impossible with the current implementation of CC because when it tries to get the latest version from VSS it would crash, because the combination of parameters that CC sends to VSS is such that it cannot ignore locally checked out files.
VSS is actually called using the executable “ss.exe”. This accepts an option for the get command called “-GWS”. The problem is that the configuration section of CC does not support this parameter so we don’t have any way to tell VSS about skipping checked out files.
The solution looks simple although it caused me some headaches. You just have to create a batch file that calls “ss.exe” with the right parameters. Below is the file:
@echo off
IF %1==history GOTO lhistory
IF NOT %1==history GOTO lget
:lhistory
“c:\Program Files\Microsoft Visual SourceSafe\ss.exe” %*
GOTO lend
:lget
“c:\Program Files\Microsoft Visual SourceSafe\ss.exe” %* -GWS
GOTO lend
:lend
@echo on
So what does this? It looks at the first parameter of the command sent by the CC and if it is “history” then it would just call the “ss.exe” with the parameters received from CC otherwise it would add another parameter “-GWS”. Why the branch? because the history command does not support the option GWS and you’d get errors.
To use this just replace the name of the executable of VSS in your ccnet.config file to use the batch file and not “ss.exe”. Like this:
<executable>c:\Program Files\Microsoft Visual SourceSafe\SS.bat</executable>
Of course this can be further improved and the idea used for other purposes.
Happy integration!



Entries (RSS)