4

A build step in my team city setup produces a log file. How do I include the contents of that file in the build log?

I already tried the "type" command, but that does not work.

I know I could list the file as artifact so I can download it, but it is really just a log file, so the right place would be in the build log.

The command line build step contains the following script:

SomeBatch.bat
type LogOutput.txt

SomeBatch.bat calls an EXE that writes the LogOutput.txt.

theDmi
  • 17,546
  • 6
  • 71
  • 138

2 Answers2

4

It turned out that the type command (Windows alternative of cat) was the right way to do it, after all. But since the first line of the command line build step is to call a batch file and I forgot to add a "call" statement, the type did not work for some reason.

So here is the working build step script:

call SomeBatch.bat
type LogOutput.txt
theDmi
  • 17,546
  • 6
  • 71
  • 138
-1

You can change your build step to output the log to stdout. You can also output the log in teamcity service message format

http://confluence.jetbrains.com/display/TCD7/Build+Script+Interaction+with+TeamCity

Biswajit_86
  • 3,661
  • 2
  • 22
  • 36
  • The point is that I can't log to stdout directly, the log is written to a file. And unfortunately there is no service message to tell TeamCity to read a file and write its contents to the build log. So I'm afraid this is not a solution. – theDmi Sep 19 '14 at 07:18