I'm just getting started with CruiseControl.NET and nAnt and don't really have a good understanding of how the whole process works. We currently have most of our solutions in Visual Source 'Safe', and have the build server Label each release automatically using the AssemblyInfo file.
We're migrating our VSS projects into SVN, and have modified the project build files accordingly to check out and update the SVN respositories. What we want to achieve, is to have a copy of the source in source control, that matches exactly the version of the project being deployed.
Our SVN is set up thus:
svn://solution/
TRUNK/
RELEASES/
1.0.0/
1.2.0/
BRANCHES/
So when we force build our solution, with its assemblyinfo version set as 1.3.0, we want the build server to copy the TRUNK directory, into the RELEASES/1.3.0/ directory.
The SVN command is fairly simple. svn copy src/directory dst/directory. But where would I put this command, and how do I get the version number for the destination?
On the build server, this is an example of an .xml file:
<sourcecontrol type="svn">
<trunkUrl>svn://project/trunk</trunkUrl>
<workingDirectory>D:\Builds\project\Src</workingDirectory>
<executable>C:\Subversion\bin\svn.exe</executable>
<username>sf_service_dev</username>
<password>SFx4vi-r</password>
<tagOnSuccess>true</tagOnSuccess>
<cleanCopy>true</cleanCopy>
</sourcecontrol>
In the project .build file we have this (and a lot more of course):
<target name="Deploy_Release">
<property name="fileandpathformyfile" value="${CCNetWorkingDirectory}\Bin\project.exe"/>
<echo message="fileandpathformyfile is ${fileandpathformyfile}."/>
<property name="ReleaseNumber" value="${fileversioninfo::get-file-version(fileversioninfo::get-version-info(fileandpathformyfile))}"/>
<echo message="ReleaseNumber has been detected to be ${ReleaseNumber}."/>
<!--Use version as needed-->
<!--Create the release direcory-->
<mkdir dir="${CCNetWorkingDirectory}\..\Releases\${ReleaseNumber}"/>
<!--Copy stuff to the release directory-->
<copy todir="${CCNetWorkingDirectory}\..\Releases\${ReleaseNumber}">
<fileset basedir="${CCNetWorkingDirectory}\bin">
<include name="*.dll" />
<include name="*.exe" />
<include name="*.config" />
<include name="*.xml" />
<include name="*.stp" />
</fileset>
</copy>
</target>
Now, if I want to run an SVN command to copy ${trunkURL} to ${trunkURL}/../releases/${ReleaseNumber}, how would I do this and in what file would it go? How I understand it at the moment, we either need to get the ReleaseNumber from the .build file, into the .xml file, and run an from there. Or, we need to pass through the trunkURL from the .XML to the .build, and run an svn command from the .build file.
Please help!