Is it possible to configure dynamic agent requirement?

Hello TeamCity experts,  I am trying to find an elegant way to enable Teamcity users to choose agent OS (unix sles10 or sles11) when triggering a build chain. (the build chain is assigned to both pools- sles10 and sles11)  I can set environment variable in the buildagent.properties file which will contain the OS information and set agent requirements accordingly, but when configuring agent requirement I can only choose static values, so I will have to change agent requirements in all configuration on the build chain.  Is there a way to set all configuration on the build chain with the same agent requirements as the first configuration? (I don’t want all the builds to run on the same agent, just to have the same agent requirements)   or even set agent requirements on project level?Thanks,  Yarden  
3 comments
Comment actions Permalink

Hi Yarden,

Dynamic agent requirements are not supported. We have the related feature request https://youtrack.jetbrains.com/issue/TW-19877, please vote for it.
However the recommended approach is to configure different build configurations to run on different OSs. You can user templates to simplify the setup. In this case there will be a separate build configuration on TeamCity server, that will show the project status for a specific OSs.
Please see the related section in the documenation: https://confluence.jetbrains.com/display/TCD9/Build+Dependencies+Setup.

0
Comment actions Permalink

TW-19877 has been fixed in 2018.1, but still it is a bit unclear how exactly to use this new feature. A few examples would be very helpful.

0
Comment actions Permalink

Hi Bo,

The difference is that now you can use parameter references as agent requirements. Before, it wasn't possible.

So for example, you could use %some.value% must be equal to %some.other.value% (while before you could only assign a fixed value there). There is a restriction. %some.value% can be roughly anything, but %some.other.value% will not be possible to resolve if it's an agent parameter.

0

Please sign in to leave a comment.