I would really appreciate some guidance on the best way to implement a simple TeamCity plugin to return a standard HTTP Response Header indicating the status of all current builds (rolled up), I would like the plugin to work along the following lines.
- Expose a non authenticated buildStatus page, e.g. http://<myTeamCityServer>:771/buildstatus.html?guest=1 that returns the HTTP Response Header (no HTML page content required in the response).
- The buildStatus page to return an 'HTTP/1.1 200 OK' (or similar) in the HTTP Response Header if all build configurations under all projects are currently successful
- The buildStatus page to return an 'HTTP/1.1 409 CONFLICT' (or similar) in the HTTP Response Header if all build configurations under all project are currently successful
I'm intending to switch a simple physical set of traffic lights (green and red only) on and off based on the polling the buildStatus page and retrieving the HTTP status code.
I have taken a read through the TeamCity plugin documentation, including the WebUIExtensions (http://confluence.jetbrains.net/display/TCD6/Web+UI+Extensions#WebUIExtensions-DevelopCustomController) and think that creating a new WebUI page that chats with REST API (to inspect project statuses) would be the simplest approach, is this possible? However, being new to TeamCity plugin development any input as to the best way to achieve this (or a better way) would be greatly appreciated?
I will also open source this as a plugin for the community.