agent plugin to alter agent properties


I would like to 'dedicate' some of our agents to important build configurations during
normal office hours while using them for all suitable builds otherwise.

Currently my idea is to implement an agent side plugin and to specify some agent properties like


and have the plugin replace the "timeslot_[0-2][0-9]_[0-2][0-9]" with true or false (if the agents local time is in this time range).

Is this a reasonable approach ? What would be the right place to implement this ?


1 comment
Comment actions Permalink


Sorry for the delay with the answer. I had in mind to write a quick plugin based on your idea, but unfortunately does not have time so far (while it should not take long).
My idea was to do this based on (which is a prototype/not-always-working implementaiton for supporting special sequences in property values using TeamCity's resolver mechanism).

In your case the task can achieved just by calling (BuildAgent) agent).getConfiguration().addCustomProperty(...) in an agent plugin and then setup a background task to update the value regularly.

BTW, your approach is quite a clever way to address a need similar to TW-1645.
The downside of theis approach is that you will probably need to add a corresponding agent requirement to all the restricted build configurations on the server that that they all respect the logic.


Please sign in to leave a comment.