Teamcity service messages

sam shiles's Avatar

sam shiles

06 Mar, 2015 09:39 AM

I'm having trouble getting service message from ocotpus back to teamcity to work. The service message appears in the build log but teamcity is ignoring it. If I output the exact same service message directly from teamcity, it works perfectly. I don't get any warnings or errors, it just seems that teamcity ignores the message.

Example messages are:

##teamcity[importData type='nunit' path='\\blah\c$\Octopus\Applications\CI\project\2.0.130-dev19e3b30_1\TestResult_Tests.EndToEnd.xml']
##teamcity[setParameter name='octo.testresultsfile' value='mypath']

What I've tried:

- Checked for odd control characters including line endings
- Tried setting a parameter ##teamcity[setParameter name='octo.testresultsfile' value='mypath'] in one step and referencing in the next
- Looked at the teamcity plugin code, it looks like the service message are just being written to stdout
- Tried output the service message from both the octopus step script (deploy) and a checked in deploy.ps1


Teamcity: 8.1 (build 29879)

  1. Support Staff 1 Posted by Paul Stovell on 09 Mar, 2015 12:43 AM

    Paul Stovell's Avatar

    Hi Sam,

    I just tried this myself and got the same result. I think the issue is that TeamCity only reads service messages if they are on a line by themselves. However when Octo.exe outputs text from the build log, it writes:

    [Success: Tentacle script execution] ##teamcity[setParameter name='ddd' value='fff']

    Which means TeamCity doesn't read the message.

    I don't think there's an easy fix for this -- perhaps you could output the test results to a more deterministic path, and have a PowerShell script in TeamCity which runs after the deployment and which reads the file from that path and uses the service message to have it imported.


  2. 2 Posted by Sam Shiles on 09 Mar, 2015 11:32 AM

    Sam Shiles's Avatar

    Hi Paul,

    Thanks for the response, I came to the same conclusion as you in the end. The thing that threw me the most though is the option --enableServiceMessages, which would indicate that this should work. What does this option do?


  3. Support Staff 3 Posted by Paul Stovell on 09 Mar, 2015 10:43 PM

    Paul Stovell's Avatar

    Hi Sam,

    Octo.exe raises various service messages to indicate a release number, as well as logs (to get the nice indented output). We do this if we detect we're running under TeamCity (TC passes an environment variable), or --enableServiceMessages can be used to test it when not running under TeamCity.


  4. Paul Stovell closed this discussion on 04 Jan, 2017 07:46 AM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac