开发者

Getting CruiseControl.NET to use output from long-running task when displaying "Activity"

开发者 https://www.devze.com 2023-02-16 16:00 出处:网络
In CruiseControl.NET, I have two projects set up, one for building and one for deploying build packages.

In CruiseControl.NET, I have two projects set up, one for building and one for deploying build packages.

Our build is largely based around MSBuild, and as it runs the dashboard constantly updates with the latest output from the build. This means that even though a full build may take 15 minutes, you can see exactly where it is, and that it's making progress.

The deploy is run using another tool (VisualBuild, though I'm see the same basic behaviour with other tools like PowerShell). This is another long-running task, but in this case the dashboard is not updated with its output as it progresses. Since a deploy may take a long time, it's hard to tell whether things are progressing or if things have stalled. The output is getting logged to the CruiseControl.NET log, and will display on the dashboard once things are done, but not while the deploy is in progress.

Is there a way to get output from other arbitrary long-running tasks updated on the dashboard in something resembling real time? What makes MSBuild special in开发者_StackOverflow this regard?


CruiseControl.Net, since version 1.4, includes support for build listener files: it's a mechanism which allows tracking the execution of long-running tasks by reading from a log file. While this mechanism is generic, and can be used with any tool, CruiseControl.Net by itself ships only with build listeners for MSBuild and NAnt (which means that for those two tools progress is reported automatically, without the need for extra configuration).

For an external tool, such as VisualBuild, called by <exec> task, you would have to plug in your own logger that creates a simple progress file:

<data>
  <Item Time="2007-10-14 08:43:12" Data="Starting Build timetester" />
  <Item Time="2007-10-14 08:43:16" Data="Starting Target build" />
  <Item Time="2007-10-14 08:43:16" Data="Sleeping for 5000 milliseconds." />
</data>

in the location pointed to by the CCNetListenerFile environment variable.

0

精彩评论

暂无评论...
验证码 换一张
取 消