Agent requirements: how to handle multiple versions of 3rd-party components?

Hi all

We would like to set up the following agent requirements scenario: a build that requires version 1 or 2 of a specific 3rd-party software, and an agent that hosts version 2 and 3 of the same 3rd-party software.

How can this be implemented?

Specific example:
A build can run on an agent with SQL Server 2005 or 2008 installed, but not with 2000 and 2008R2. Some of our agents have SQL 2005 installed, others SQL 2008 and even others have both versions installed. How can this be modelled within TeamCity? For us the main problem seems to be that an agent cannot specify multiple versions in the file (multiple entries of the same environment variable get ignored, trying to define a set of variable as env.COMPONENT=1;2;3 does not work either).



You should be able to achieve what you want using the We do this with our setup, we have multiple different JBoss instances installed on different agents. In the file we have properties jboss42.home, jboss51.home, jboss60.home, and so on. When a build configuration is setup to run, using say JBoss 5.1, then we set a property appserver.home to %system.jboss51.home%, TeamCity sees this a requirement so any agent that doesn't have the property jboss51.home set is considered incompatible and can't run the build. So you may want to have a property for each of the SQL Server versions you use and then use within the build configuration or add as an agent requirement.

Hope that helps.



This solves the problem if a build can run on one agent and uses one particular 3rd-party component but what if an agent provides several versions and a build can run with several versions as well?

Agent1 has componentVersion1, componentVersion2 and componentVersion3 installed. Agent2 has only componentVersion3 installed.
Build configuration Test can run with componentVersion2 or componentVersion3 (but not with componentVersion1).

Test should be able to run on both agents but is only compatible on agent1 cause componentVersion2 is not installed on agent2 and agent requirements can only be linked with AND.

How can i solve this?




I think you're asking if the same build configuration can be used to run with different componentVersions, I'm not sure that's possible. But you can setup 3 build configurations to run with componentVersion1, componentVersion2 and componentVersion3, and then pass in a property or environment variable to the build to tell it which componentVersion to use when it runs. Then in the agent requirements page setup a requirement for the build for componentVersion1 to only run on an agent that has a property to indicate that componentVersion1 is installed on that agent. Does that make sense?




Thank you for the helpful replies in this and other threads!

Markus, Rod,

If the build can detect the appropriate resource to use without needing extra properties (or chosing the necessary setting from several available), then "or" requirements can be established like:

on agent, have the property: sqlServerVersions=2005,2008
in a build configuration have regexp matcher for the property value with "(2005)|(2008)" regexp.

At some point we should approach more comfortable solution in the scope of TW-14168.



First of all, many thanks to you guys for helping me.
Jip Yegor, this works. The only little add is the regexp. Our regexp looks like (.*2005.*)|(.*2008.*) and then it works fine.

Many thanks again.



Please sign in to leave a comment.