So as you may know I've started a personal project that I hope to turn commercial one day and I'm using Unfuddle to do the "project/development management" which includes a SVN repository.
I've got CruiseControl.Net setup to CI my code and it all works gloriously well but I was chatting to Glyn the bloke that put me onto Unfuddle and he mentioned that Unfuddle has a repository callback feature - rather than have CC.Net ping my Unfuddle SVN every 30 seconds to detect if a commit has occurred Unfuddle will POST details of the latest commit to the url you register as your callback - a much more efficient Pub/Sub approach.
Ok - so how to get a callback to trigger a CC.Net build? Easy!
Attempt 1
Little grey cells time....
I entered the same callback url into a browser and it worked, hmmmmm
Had I even been called by Unfuddle, maybe they were busy?
I checked the IIS log and there is was a POST from Unfuddle BUT they had stripped the querystring off the url (?ForceBuild=Force) - this is obviously the magic bit that forces a build so...
Attempt 2
I've got CruiseControl.Net setup to CI my code and it all works gloriously well but I was chatting to Glyn the bloke that put me onto Unfuddle and he mentioned that Unfuddle has a repository callback feature - rather than have CC.Net ping my Unfuddle SVN every 30 seconds to detect if a commit has occurred Unfuddle will POST details of the latest commit to the url you register as your callback - a much more efficient Pub/Sub approach.
Ok - so how to get a callback to trigger a CC.Net build? Easy!
Attempt 1
- I Fiddlered the url that the CC.Net webdashboard calls when you press the "Force Build" button on a project - it looks like this, http://[yourserver]/ccnet/server/local/project/[yourproject]/ViewProjectReport.aspx?ForceBuild=Force
- I entered this into the Unfuddle repository callback url
- Opened the required firewall ports to allow this traffic into my server (I changed port 80 to something else)
- Modified my CC.Net project config to remove all triggers (force build only)
- Committed some code...and waited...and waited....no build triggered :(
Little grey cells time....
I entered the same callback url into a browser and it worked, hmmmmm
Had I even been called by Unfuddle, maybe they were busy?
I checked the IIS log and there is was a POST from Unfuddle BUT they had stripped the querystring off the url (?ForceBuild=Force) - this is obviously the magic bit that forces a build so...
Attempt 2
- Installed the URL Rewrite module from IIS.Net
- Configured the URL Rewriter for the ccnet virtual app to include a new rule - rewrite http://[yourserver]/ccnet/[yourproject]/unfuddle.aspx to the actual url (see above) that would trigger the build
- Updated the callback url in Unfuddle to http://[yourserver]/ccnet/[yourproject]/unfuddle.aspx
- Committed again - bingo, about 20 seconds later my build was triggered :)
Comments
Thanks for this post, helped me a lot. I'm trying to integrate CruiseControl.NET with Unfullde too.
And I need to to "pull" rather than "push". Any advice on that?