1

I'm new to FTL templates and I want to show the first 100 lines of the build log. I'm given the original script to show the entire build log from the TC documentation, which is this:

<#list build.buildLog.messages[1..] as message><#-- skipping the first message (it is a root node)-->
  <#if message.status == "ERROR" || message.status == "FAILURE" > 
    ${message.text}
  </#if>
</#list>

What should I add/change to only show the first 100 lines?

4

1 回答 1

1

目前,此答案仅对 build_fail.ftl 模板有效,但将 build.buildLog.messages 中的索引范围更改为 0..99 有助于:

<#list build.buildLog.messages[0..99] as message>

我在这个博客上发布了一个答案,并在我的评论中得到了答案:http: //www.mikeobrien.net/blog/build-timing-and-error-details-teamcity-notifications/

于 2015-03-09T15:50:08.913 回答