Run build on cc.net if certain words are included in the commit log

I have a system:

  • svn - management version
  • cc.net - as a ci server
  • msbuild - as a build system
  • nunit - to run a test
  • webdriver - for web testing.

Now my tests run automatically after each commit. But I want my test to run if commit has a #runautotest (or other) comment.

I researched cc.net triggers, but this is for other purposes. I am trying to find some information about cc.net parsing logs, but this does not have a positive result.

What methods can I use to solve my problem?

+5
source share
2 answers

ccnet :

<modificationWriter>
 <filename>svn_mods.xml</filename>
 <path>c:\modsdir</path>
</modificationWriter>

SVN .

:

<nant>
 <executable>c:\path_to_nant</executable>
 <buildFile>mybuildfile.build</buildFile>
 <targetList>
  <target>conditionally_run_nunit_tests</target>
 </targetList>
</nant>

Nant changewriter.

conditionally_run_nunit_tests c:\modsdir\svn_mods.xml #runautotest. , . , . mods. # script, , #runautotest.

# script Nant. SearchFile , , . "" "". script .

<property name="yesno" value="${ns::SearchFile("c:\modsdir\svn_mods.xml", "#runautotest")}"/>

<script language="c#" prefix="ns">
    <references>
        <include name="System"/>
        <include name="System.IO"/>
    </references>
    <code>
    <![CDATA[   
    [Function("SearchFile")]
    public static string SearchFile(string filepath, string token) 
    {
        System.IO.StreamReader myFile = new System.IO.StreamReader(filepath);
        string myString = myFile.ReadToEnd();
        myFile.Close();
        if(myString.Contains(token)) return "yes";
        else return "no";
    }               
    ]]>
    </code>
</script>
+3

upvotes, , , . : , CCNET , SVN , , MSBuild NUnit WebDriver .

, , SVN. SVN NUnit WebDriver CCNET.

, , , , , CCNET -. SVN, , CCNET. ?

. CCNET - . DynamicValues ​​ CCNET 1.5 ConditionalTasks CCNET 1.6 , CCNET, , , script, , , MSBuild NAnt .

. . , ( <xmlpeek> <script>).

0

All Articles