使用nant构建存档并将其显示在cruisecontrol.net包列表中

发布于 2024-10-12 08:22:11 字数 192 浏览 4 评论 0原文

我不确定这是否可行,但目前我正在使用带有 nAnt 脚本的 CruiseControl.net 构建服务器来处理所有构建、测试和打包。我让 nAnt 操作一些文件并将它们存档。有没有办法显示 nAnt 脚本在 CruiseControl.net 包列表中生成的 zip 文件?我正在使用 ccnet 1.5 和 nAnt 0.91 alpha2。

谢谢。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

一场信仰旅途 2024-10-19 08:22:11

经过大量研究,我得出这样的结论:

  1. 包仅显示与该构建相关的文件,而不是全部。
  2. 您只能在 CCNet.config 中构建这些包
  3. 如果您手动制作包,它将在构建服务器中损坏

可能可以创建包并将所需的文件放入文件夹中,但您必须修改一些统计文件之类的,但我放弃了,没有人对此做出回应。

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.

浅浅淡淡 2024-10-19 08:22:11

我这样做是因为我对 ccnet 的软件包发布者不满意。首先你需要欺骗 ccnet 创建一个虚拟包;该包将在 [ArtifactDirectory]\[CCNetLabel] 中创建。然后运行一个 nant 脚本来替换包并更新包 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>

最后一部分确保包大小在 PackageList 网页中正确显示。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文