0
votes

I'm not sure if this is possible, but currently I am using a CruiseControl.net build server with a nAnt script to handle all of the building, testing, and packaging. I have nAnt manipulate some files and archive them. Is there a way to display that zip file that the nAnt script generated in the CruiseControl.net Package List? I am using ccnet 1.5 and nAnt 0.91 alpha2.

Thanks.

2

2 Answers

1
votes

After much research, I have come to this conclusion:

  1. Packages only show the files related to that build not all.
  2. You can only build these packages within the CCNet.config
  3. If you make a package by hand, it will be corrupted within the build server

It might be possible to create the package and drop the required files in the folder, but you will have to modify a couple of the statistic files and what not, but i gave up and no one has responded to this.

0
votes

I did this because I was not happy with ccnet's package publisher. First you need to trick ccnet into creating a dummy package; the package will be created in [ArtifactDirectory]\[CCNetLabel]. Then run a nant script which replaces the package and updates the package xml.

ccnet config:

<publishers>
  <package>
    <name>Build-$[$CCNetLabel]</name>
    <compression>0</compression>
    <packageList />
  </package>
  <nant>
    <buildArgs>-D:PackageName="Build-$[$CCNetLabel]"</buildArgs>
    <buildFile>script.build</buildFile>
    <targetList>
      <target>PackagePublisher</target>
    </targetList>
  </nant>
</publishers>

nant:

<target name="PackagePublisher">
  <property name="PackageDirectory" value="${CCNetArtifactDirectory}\${CCNetLabel}" />
  <property name="PackageFullPath" value="${PackageDirectory}\${PackageName}.zip" />
  <delete file="${PackageFullPath}" />
  <zip zipfile="${PackageFullPath}">
    <fileset>
       <!-- include everything you need to package -->
    </fileset>
  </zip>

  <!-- find package.xml; it is the only xml file in the PackageDirectory -->
  <foreach item="File" property="PackageXml">
    <in>
      <items basedir="${PackageDirectory}">
         <include>*.xml</include>
      </items>
    </in>
    <do>
      <xmlpoke file="${PackageXml}" xpath="//package[@name='${PackageName}']/@size" value="${file::get-length(PackageFullPath)}" />
    </do>
  </foreach>
</target>

The last part ensures the package size is displayed properly in the PackageList web page.