Using CruiseControl to Copy the SVN Folder to the Release Folder

I am just starting out with CruiseControl.NET and nAnt and really don’t really understand how the whole process works. We currently use most of our solutions in Visual Source 'Safe', and each time the AssemblyInfo file places each version of each publication, automatically create an assembly file.

We migrate our VSS projects to SVN and modified the project build files to check and update SVN repositories. What we want to achieve is to have a copy of the source in the source control that exactly matches the version of the project being deployed.

Our SVN is configured this way:

svn://solution/  
    TRUNK/
    RELEASES/
         1.0.0/
         1.2.0/
    BRANCHES/

Therefore, when we forcefully create our solution, with its assemblyinfo version set to 1.3.0, we want the build server to copy the TRUNK directory to the RELEASES / 1.3.0 / directory.

The SVN team is pretty 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 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 .build project file, we have this (and much 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 the SVN command to copy $ {trunkURL} to $ {trunkURL} /../ release / $ {ReleaseNumber}, how do I do this and in which file will it go? As I understand this at the moment, we either need to get the ReleaseNumber from the .build file, into the .xml file, and run from there. Or we need to go through trunkURL from .XML to .build and run the svn command from the .build file.

Please, help!

+3
1

- (aka svn copy) . .

, <tagOnSuccess> enabled

<tagBaseUrl>svn://project/trunk/Releases</tagBaseUrl> <tagBaseUrl>svn://project/trunk/Tags</tagBaseUrl>

, . , , .

,

  • nAnt exec task
  • if, %CCNetRequestSource% ForceBuild
  • svn (CCNetWorkingDirectory , release # )

nantcontrib, , svn task

, CC.Net # labeller nAnt CCNetLabel . , , , , " Labeller" , , .

CC.Net labeller - , , , <tagOnSuccess> .

+5

Source: https://habr.com/ru/post/1719573/


All Articles