Teamcity status macro for Trac
May 19th 2009Joeinternet,
programming,
tech
I had a need to print the build status of our teamcity server in trac. After researching various solutions, I figured a trac macro would best fit. It was a surprisingly simple solution so I figured I would share it here.
I created a file called “TeamCityStatus.py” and placed it into my trac/plugins folder.
from urllib import urlopen
from trac.wiki.macros import WikiMacroBaseclass TeamCityStatusMacro(WikiMacroBase):
“”"Inserts the current build status into the wiki page.”"”def expand_macro(self, formatter, name, args):
res=urlopen(’example.org/teamcity/externalStatus.html?withCss=true’).read()
return res
Obviously change the URL open line to match your teamcity installed location.
Then inside any wiki page on your trac site, just place the macro command “[[TeamCityStatus]]”. You should be good to go!
