Dump Build Log file while build running

I need to perform intermediate build log parsing at certain points in my build. I have an existing process that I want to pass the team city build file to.

What I’m attempting to do is download the current running build log file (I have already obtained the build id) and save it to a share on the network where my parse process can access it. However, I get an error indicating the file is not available.

<!-- Download TeamCity Build Log as Build.log -->
<get src="$" dest="$">
<credentials username="$" password="$" domain="$" />
</get>

Is it possible to dump the build log file while the build is running? It seems the build log file is not available until the build completes, is this correct? I understand you can send Service Messages via the output stream in the build runner of choice but it appears to not support the build log file.

I was also wondering, is there a way to treat the build log file as an artifact? If so, I would be able to send a Service Message to generate the build file as it supports creation of artifacts on the fly.

I know I could split my build into two smaller builds and leverage the build dependency functionality so I can have access to the build log file for build A in build B. However, I'd prefer not to do that if I do not need too.

Thanks,

Sean

Edited by: Sean Gilbert on May 27, 2008 6:59 PM

Edited by: Sean Gilbert on May 27, 2008 7:01 PM

5 comments

What URL do you use to download build log? And what version of TeamCity do you use?

--
Pavel Sher

0

I'm using TC 3.1.1 (build version - 1.0.6828.6828) with the following configuration:

TC Build Server - Windows XP SP2 Machine 1
TC Build Agent - Windows XP SP2 Machine 2
Leveraging Oracle 10g as the backend.

I use the following URL to download the build file:
http://IP_ADDRESS/downloadBuildLog.html?buildId=36

The IP_ADDRESS is the IP address of the TC Build Server and the buildId is the current running build id.

I just found what looks to be a version of the build log file in the Build Agent/logs directory called teamcity-agent.log, is that correct?

0

Such url expects that it will be used from a browser (i.e. it expects that correct cookies are sent). In you case you should add /httpAuth/ prefix:
http://IP_ADDRESS/httpAuth/downloadBuildLog.html?buildId=36

/httpAuth/ tells TeamCity that request is sent from a tool that can authenticate via HTTP basic authentication and probably does not support cookies. In other words it's an alternative way to authenticate in TeamCity specially designed for command line tools.

--
Pavel Sher

0

It is working now, stupid me had the wrong IP address.

0

You are correct. To get this to work I used /httpAuth/ in combination with a null domain name in the credentials.domain attribute for the NAnt . URL: http://IP_ADDRESS/httpAuth/downloadBuildLog.html?buildId=42 ]]>
<get src="$" dest="$">
<credentials username="$" password="$" domain="" />
</get>

Thanks,

Sean

0

Please sign in to leave a comment.