Question

In cc.net most of staging projects are configured to build on code check in, but sometimes we stop them for some reason to prevent new builds. The problem is, that sometimes it is not clear, why project was stopped, so we would like to save reason with a click of a stop button. Is it possible to add such functionality by configuring cc.net/writing custom extension?

Was it helpful?

Solution

I've done it, it looks hacky and to be fair - it is hacky.

What I have done is split into two parts:

1) Plugin part, which implements IPlugin interface with two actions: Display and Save, I think names are quite descriptive - one reads request parameters and saves then to file, other read file and returns data for display.

2) UI part. I edited two view templates (ProjectReport.vm and ProjectGrid.vm) to include jQuery event handlers for stop button, to show jQuery UI dialog with text area for stopping reason before submitting the form and save it using my plugin. As long as jQuery and jQuery UI were already used in cc.net that wasn't a big problem (it still was some problem, as we use quite old cc.net version, so jQuery there is quite outdated).

in cctray stopping project does not work for some reason, so I didn't spent time to change it.

Overall it looks like cruisecontrol.net was trying to make plugin friendly architecture, but in reality it is very hard to extend it in the way I wish without hacking and using questionable implementations. Plus documentation is very weak, I had to use source code to understand how to write plugin and that was time consuming. Also security model in cc.net is kind of strange.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top