12

TeamCity ビルドログのツリービューで折りたたみ可能なセクションとしてレンダリングされるように、powershell 出力をフォーマットすることは可能ですか?

たとえば、私のビルド ステップでは、powershell ランナーを使用して、

write-host " #################  deployment manifest ############################"
ls -r -i *.* | %{ $_.FullName }

これはこれを出力します:

[15:28:13] #################  deployment manifest ############################
[15:28:13]\\10.10.10.49\d$\sites\account.foo.net\v32\Bin
[15:28:13]\\10.10.10.49\d$\sites\account.foo.net\v32\contact
[15:28:13]\\10.10.10.49\d$\sites\account.foo.net\v32\Content
[15:28:13]\\10.10.10.49\d$\sites\account.foo.net\v32\controls
[15:28:13]\\10.10.10.49\d$\sites\account.foo.net\v32\error

ログの一部をツリー ビューで折りたたむことができるようにしたいと考えています。

4

1 に答える 1

19

Yes we do this with our powershell scripts, you need to get your build script to update Teamcity with the build status. More specifically you need to report the build progress which will tell Teamcity when the start and the end of a block of work occurs. After the build has finished Teamcity will use this information to create nodes on the tree view of the log.

In powershell do the following:

write-host "##teamcity[progressStart '<message>']"

do work

write-host "##teamcity[progressFinish '<message>']"

Note You need to make sure that the message is the same in the start and finish message, blocks can be nested. You can also use the block message instead. I don't know exactly what the difference is but you appear to get the same results:

write-host "##teamcity[blockOpened name='<blockName>']"

do work

write-host "##teamcity[blockClosed name='<blockName>']"
于 2012-04-27T20:55:53.260 に答える