views:

346

answers:

1

I am running the ccnet server on a windows Server 2003 Operating system. The builds for my product happen fine. But the label remains "1.0.1.0" always. If I do a force build through the web dashboard the version is incremented, but otherwise, the version does not get incremented.

Can anybody tell me if there is something I am missing. Is it a known issue? Are there workarounds?

The cruise control configuration file for the product (project_config.xml) looks like the this:

<cb:config-template xmlns:cb="urn:ccnet.config.builder">

  <project name="MyProduct">
    <workingDirectory>$(MyProductRootDir)</workingDirectory>
    <artifactDirectory>$(MyProductRootDir)\build</artifactDirectory>
    <webURL>http://local/ccnet/server/local/project/MyProduct/ViewProjectReport.aspx&lt;/webURL&gt;
    <modificationDelaySeconds>900</modificationDelaySeconds>
    <sourcecontrol type="clearCase">
      <viewPath>$(MyProductRootDir)</viewPath>
      <branch>main</branch>
      <autoGetSource>true</autoGetSource>
      <useLabel>false</useLabel>
    </sourcecontrol>
    <triggers>
      <scheduleTrigger time="06:00" name="6AM_build">
        <weekDays>
          <weekDay>Monday</weekDay>
          <weekDay>Tuesday</weekDay>
          <weekDay>Wednesday</weekDay>
          <weekDay>Thursday</weekDay>
          <weekDay>Friday</weekDay>
        </weekDays>
      </scheduleTrigger>
      <scheduleTrigger time="09:00" name="9AM_build">
        <weekDays>
          <weekDay>Monday</weekDay>
          <weekDay>Tuesday</weekDay>
          <weekDay>Wednesday</weekDay>
          <weekDay>Thursday</weekDay>
          <weekDay>Friday</weekDay>
        </weekDays>
      </scheduleTrigger>
      <scheduleTrigger time="12:00" name="12PM_build">
        <weekDays>
          <weekDay>Monday</weekDay>
          <weekDay>Tuesday</weekDay>
          <weekDay>Wednesday</weekDay>
          <weekDay>Thursday</weekDay>
          <weekDay>Friday</weekDay>
        </weekDays>
      </scheduleTrigger>
      <scheduleTrigger time="15:00" name="3PM_build">
        <weekDays>
          <weekDay>Monday</weekDay>
          <weekDay>Tuesday</weekDay>
          <weekDay>Wednesday</weekDay>
          <weekDay>Thursday</weekDay>
          <weekDay>Friday</weekDay>
        </weekDays>
      </scheduleTrigger>
      <scheduleTrigger time="18:00" name="6PM_build">
        <weekDays>
          <weekDay>Monday</weekDay>
          <weekDay>Tuesday</weekDay>
          <weekDay>Wednesday</weekDay>
          <weekDay>Thursday</weekDay>
          <weekDay>Friday</weekDay>
        </weekDays>
      </scheduleTrigger>
    </triggers>
    <labeller type="assemblyVersionLabeller">
      <major>1</major>
      <minor>0</minor>
      <incrementOnFailure>true</incrementOnFailure>
    </labeller>
    <tasks>
      <msbuild>
        <executable>$(msbuildexe)</executable>
        <workingDirectory>build</workingDirectory>
        <projectFile>build.targets</projectFile>
        <buildArgs>/p:Configuration=Debug /fileLoggerParameters:LogFile=build_log.txt</buildArgs>
        <targets>Build</targets>
        <timeout>1200</timeout>
        <logger>FileLogger,Microsoft.Build.Engine</logger>
      </msbuild>
    </tasks>
    <publishers>
      <xmllogger logDir="E:\ccnet\logs\MyProduct" />
      <statistics />
    </publishers>

    <externalLinks>
      <externalLink name="build_output" url="http://local/builds/MyProduct" />
    </externalLinks>

  </project>
</cb:config-template>

and my ccnet.config file looks like this

<cruisecontrol xmlns:cb="urn:ccnet.config.builder">

  <cb:define msbuildexe="C:\WINDOWS\Microsoft.NET\Framework\v3.5\msbuild.exe"/>

  <cb:define cyraftframeworkrootdir="E:\myProduct"/>
  <cb:include href="project_config.xml" xmlns:cb="urn:ccnet.config.builder"/>

</cruisecontrol>
+1  A: 

This was because of a bug in the assembly version labeller that incremented only if the build condition was 'ForceBuild'. So if a build was triggered because of modifications to source code in which case, the build condition of the trigger would be 'IfModificationExists', the version number would not be incremented.

This has been fixed. Details of the bug is here:

http://jira.public.thoughtworks.org/browse/CCNET-1762

Poulo