I’ve been trying to get our Unfuddle repositories to be smarter by notifying the CI server when something has been committed. To date, Unfuddle only supports there Callback URL functionality and not any sort of Git hooks.
Based on the specification from Unfuddle, they are doing a POST to the URL specified with data regarding the commit. Looking at the TeamCity specification, the URL they provide is wanting a GET. Since I’m not sure if TeamCity as actually looking for a GET or only accepting a GET, I decided to investigate further.
After opening up one of my favorite debugging tools, Fiddler, I looked at the POST request from clicking the “Run” button on the TeamCity interface. Upon doing so, I built the URL:
This tells TeamCity to run a build from the latest changes and add the comment: “Callback from Unfuddle”. The build type parameter is simply a reference to the build specification in TeamCity.
So, to test this theory out, I installed a Firefox add-on called HTTP Resource Test to test out actually a POST to this URL. This worked out perfectly. By build was triggered without a hitch including my build comments.
All that is left is to put my URL in the Unfuddle repository settings and away we go. I then made some commits on the local Git repository and then pushed those changes to Unfuddle. Waiting with bated breath, nothing happened.
Ok, what went wrong. I contacted Unfuddle support and it turns out that they aren’t passing QueryString parameters but the Callback URL was firing. So, back to square one.
At this point, I think my only option is to setup a proxy server to work with both parties. I looked at the Git hooks and there doesn’t seem to be a post-push (out of the box, there maybe an add-on/extension) that I can filter by pushing to Unfuddle to then run a script locally to do the GET or POST to the build server. Post-receive won’t work because again, Unfuddle can’t run hooks.
Anyway, when I get more time, I may investigate further and blog again about my solution.