Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Subversion block in CruiseControl.NET - passing specific revision number?

I would like the ability to pass a specific revision to the SVN task (in ccnet.config) that I want the buildserver to checkout from SVN and build. So I don't always want the latest revision. And no, I don't want to create a tag for every successful build.

Looking at the configuration elements here: http://ccnet.sourceforge.net/CCNET/Subversion%20Source%20Control%20Block.html

And I cannot see anything that allows me to do this. The idea is to be able to pass an optional parameter (using the Dynamic Properties in 1.5) and simply pass that into something for the SVN task. Is this achievable at all with the current CCNET SVN plugin? Am I missing something obvious?

like image 299
Wim Avatar asked Dec 18 '22 05:12

Wim


2 Answers

Can be easily achieved directly with CCNET scripts this way :

<project name="whatever">
    <parameters>
        <textParameter name="VersionToBuild">
            <display>SVN Version to Build</display>
            <description>Which SVN version to Build?</description>
            <default>HEAD</default>           
            <required>true</required>
        </textParameter>
    </parameters>

    <sourcecontrol type="svn">
        <trunkUrl>http://svnrepo.mydomain.com:80/svn/myProject/trunk@$[VersionToBuild]</trunkUrl>
        <workingDirectory>c:\Checkout\myProjectTrunk</workingDirectory>
        <executable>c:\Subversion\bin\svn.exe</executable>
        <username>dummy</username>
        <password>dummy</password>      
    </sourcecontrol>
</project>
like image 193
jsuard Avatar answered Mar 05 '23 19:03

jsuard


You can set up your own nant exec task to retrieve the source from subversion rather than using the sourceControlProvider block. This would allow you to retrieve whichever revision you like.

If you still want to use the sourceControlProvider block to trigger the build, set autoGetSource="false". However, seeing as you are wanting to build a specific revision, I don't know if the trigger functionality of the sourceControlProvider would be useful.

like image 30
g . Avatar answered Mar 05 '23 17:03

g .