Meta-runner and agent requirements

Hi,

Can a meta-runner include agent requirements? I want the agents available to be restricted to those that meet requirements for a build step based on a meta-runner.

I do see mention in documentation of "implicit requirements" and also another post "Can Meta-Runners have dependencies or Agent Requirements?". But I have not been able to find a solution from these. If possible ... an example code fragment for a Meta-Runner XML would be great.

Thanks

Rob

 

2 comments
Comment actions Permalink

You can add agent requirements to your meta-runner by inserting something like the following:

<requirements>
  < <condition> name=<parameter name> value=<desired parameter value> />
</requirements>

The condition can be one of the following:

  • exists
  • does not exist
  • equals
  • does not equal
  • is more than
  • is not more than
  • is less than
  • is not less than
  • starts with
  • contains
  • does not contain
  • ends with
  • matches
  • does not match
  • version is more than
  • version is not more than
  • version is less than
  • version is not less than

I've included an example entry placed within a meta-runner xml file below. The requirement is that the teamcity.agent.name is equal to Agent1.

<?xml version="1.0" encoding="UTF-8"?>
<meta-runner name="Build_metarunner">
<description>My MetaRunner</description>
<settings>
<parameters>
</parameters>
<build-runners>
<runner name="" type="simpleRunner">
</runner>
</build-runners>
<requirements>
< equals name="teamcity.agent.name" value="Agent1" />
</requirements>
</settings>
</meta-runner>
0
Comment actions Permalink

Excellent response. Exactly what I needed.

Thank you

0

Please sign in to leave a comment.